title: Cannot install packages to R after brew install
body: <p>I've spent about an hour trying to debug this, but I think it's best to assume I haven't tried anything except <code>brew install r</code> and <code>install.packages("tidycensus")</code> and a few other packages to check if it was <code>tidycensus</code> specifically. </p>
  
  <p>Let me know if there's any information I can provide.  I recently wiped the hard drive of my fairly new Mac and started fresh.</p>
  
  <p>The output of <code>install.packages("tidycensus")</code>: </p>
  
  <pre><code>&gt; install.packages("tidycensus")
  Installing package into ‘/usr/local/lib/R/3.5/site-library’
  (as ‘lib’ is unspecified)
  also installing the dependencies ‘rgdal’, ‘sf’, ‘tigris’, ‘units’
  
  trying URL 'https://cloud.r-project.org/src/contrib/rgdal_1.3-4.tar.gz'
  Content type 'application/x-gzip' length 1664774 bytes (1.6 MB)
  ==================================================
  downloaded 1.6 MB
  
  trying URL 'https://cloud.r-project.org/src/contrib/sf_0.6-3.tar.gz'
  Content type 'application/x-gzip' length 7973054 bytes (7.6 MB)
  ==================================================
  downloaded 7.6 MB
  
  trying URL 'https://cloud.r-project.org/src/contrib/tigris_0.7.tar.gz'
  Content type 'application/x-gzip' length 72980 bytes (71 KB)
  ==================================================
  downloaded 71 KB
  
  trying URL 'https://cloud.r-project.org/src/contrib/units_0.6-0.tar.gz'
  Content type 'application/x-gzip' length 912393 bytes (891 KB)
  ==================================================
  downloaded 891 KB
  
  trying URL 'https://cloud.r-project.org/src/contrib/tidycensus_0.4.6.tar.gz'
  Content type 'application/x-gzip' length 1615516 bytes (1.5 MB)
  ==================================================
  downloaded 1.5 MB
  
  * installing *source* package ‘rgdal’ ...
  ** package ‘rgdal’ successfully unpacked and MD5 sums checked
  configure: R_HOME: /usr/local/Cellar/r/3.5.1/lib/R
  configure: CC: clang
  configure: CXX: clang++
  configure: C++11 support available
  configure: rgdal: 1.3-4
  checking for /usr/bin/svnversion... yes
  configure: svn revision: 766
  checking for gdal-config... no
  no
  configure: error: gdal-config not found or not executable.
  ERROR: configuration failed for package ‘rgdal’
  * removing ‘/usr/local/lib/R/3.5/site-library/rgdal’
  * installing *source* package ‘units’ ...
  ** package ‘units’ successfully unpacked and MD5 sums checked
  configure: units: 0.6-0
  checking whether the C++ compiler works... yes
  checking for C++ compiler default output file name... a.out
  checking for suffix of executables... 
  checking whether we are cross compiling... no
  checking for suffix of object files... o
  checking whether we are using the GNU C++ compiler... yes
  checking whether clang++ accepts -g... yes
  checking how to run the C++ preprocessor... clang++ -E
  checking for grep that handles long lines and -e... /usr/bin/grep
  checking for egrep... /usr/bin/grep -E
  checking for ANSI C header files... rm: conftest.dSYM: is a directory
  rm: conftest.dSYM: is a directory
  yes
  checking for sys/types.h... yes
  checking for sys/stat.h... yes
  checking for stdlib.h... yes
  checking for string.h... yes
  checking for memory.h... yes
  checking for strings.h... yes
  checking for inttypes.h... yes
  checking for stdint.h... yes
  checking for unistd.h... yes
  checking for stdbool.h that conforms to C99... no
  checking for _Bool... no
  checking for error_at_line... no
  checking for gcc... clang
  checking whether we are using the GNU C compiler... yes
  checking whether clang accepts -g... yes
  checking for clang option to accept ISO C89... none needed
  checking for XML_ParserCreate in -lexpat... yes
  checking udunits2.h usability... no
  checking udunits2.h presence... no
  checking for udunits2.h... no
  checking udunits2/udunits2.h usability... no
  checking udunits2/udunits2.h presence... no
  checking for udunits2/udunits2.h... no
  checking for ut_read_xml in -ludunits2... no
  configure: error: in `/private/var/folders/69/wy4n7cc10n5fg5_bc8glmms80000gn/T/RtmpPtsVPP/R.INSTALLf8694f0bf387/units':
  configure: error: 
  --------------------------------------------------------------------------------
    libudunits2.so not found!
  
    If the udunits2 library is installed in a non-standard location, use:
  
      --configure-args='--with-udunits2-lib=/usr/local/lib'
  
    for example, if the library was not found, and/or
  
      --configure-args='--with-udunits2-include=/usr/include/udunits2'
  
    if the header was not found, replacing paths with appropriate values for your
    installation. You can alternatively use the UDUNITS2_INCLUDE and UDUNITS2_LIBS
    environment variables.
  
    If udunits2 is not installed, please install it.
    It is required for this package.
  --------------------------------------------------------------------------------
  
  See `config.log' for more details
  ERROR: configuration failed for package ‘units’
  * removing ‘/usr/local/lib/R/3.5/site-library/units’
  ERROR: dependency ‘units’ is not available for package ‘sf’
  * removing ‘/usr/local/lib/R/3.5/site-library/sf’
  ERROR: dependencies ‘rgdal’, ‘sf’ are not available for package ‘tigris’
  * removing ‘/usr/local/lib/R/3.5/site-library/tigris’
  ERROR: dependencies ‘sf’, ‘tigris’, ‘units’ are not available for package ‘tidycensus’
  * removing ‘/usr/local/lib/R/3.5/site-library/tidycensus’
  
  The downloaded source packages are in
      ‘/private/var/folders/69/wy4n7cc10n5fg5_bc8glmms80000gn/T/Rtmp8iit6a/downloaded_packages’
  Warning messages:
  1: In install.packages("tidycensus") :
    installation of package ‘rgdal’ had non-zero exit status
  2: In install.packages("tidycensus") :
    installation of package ‘units’ had non-zero exit status
  3: In install.packages("tidycensus") :
    installation of package ‘sf’ had non-zero exit status
  4: In install.packages("tidycensus") :
    installation of package ‘tigris’ had non-zero exit status
  5: In install.packages("tidycensus") :
    installation of package ‘tidycensus’ had non-zero exit status
  &gt; install.packages('tidycensus')
  Installing package into ‘/usr/local/lib/R/3.5/site-library’
  (as ‘lib’ is unspecified)
  also installing the dependencies ‘rgdal’, ‘sf’, ‘tigris’, ‘units’
  
  trying URL 'https://cloud.r-project.org/src/contrib/rgdal_1.3-4.tar.gz'
  Content type 'application/x-gzip' length 1664774 bytes (1.6 MB)
  ==================================================
  downloaded 1.6 MB
  
  trying URL 'https://cloud.r-project.org/src/contrib/sf_0.6-3.tar.gz'
  Content type 'application/x-gzip' length 7973054 bytes (7.6 MB)
  ==================================================
  downloaded 7.6 MB
  
  trying URL 'https://cloud.r-project.org/src/contrib/tigris_0.7.tar.gz'
  Content type 'application/x-gzip' length 72980 bytes (71 KB)
  ==================================================
  downloaded 71 KB
  
  trying URL 'https://cloud.r-project.org/src/contrib/units_0.6-0.tar.gz'
  Content type 'application/x-gzip' length 912393 bytes (891 KB)
  ==================================================
  downloaded 891 KB
  
  trying URL 'https://cloud.r-project.org/src/contrib/tidycensus_0.4.6.tar.gz'
  Content type 'application/x-gzip' length 1615516 bytes (1.5 MB)
  ==================================================
  downloaded 1.5 MB
  
  * installing *source* package ‘rgdal’ ...
  ** package ‘rgdal’ successfully unpacked and MD5 sums checked
  configure: R_HOME: /usr/local/Cellar/r/3.5.1/lib/R
  configure: CC: clang
  configure: CXX: clang++
  configure: C++11 support available
  configure: rgdal: 1.3-4
  checking for /usr/bin/svnversion... yes
  configure: svn revision: 766
  checking for gdal-config... no
  no
  configure: error: gdal-config not found or not executable.
  ERROR: configuration failed for package ‘rgdal’
  * removing ‘/usr/local/lib/R/3.5/site-library/rgdal’
  * installing *source* package ‘units’ ...
  ** package ‘units’ successfully unpacked and MD5 sums checked
  configure: units: 0.6-0
  checking whether the C++ compiler works... yes
  checking for C++ compiler default output file name... a.out
  checking for suffix of executables... 
  checking whether we are cross compiling... no
  checking for suffix of object files... o
  checking whether we are using the GNU C++ compiler... yes
  checking whether clang++ accepts -g... yes
  checking how to run the C++ preprocessor... clang++ -E
  checking for grep that handles long lines and -e... /usr/bin/grep
  checking for egrep... /usr/bin/grep -E
  checking for ANSI C header files... rm: conftest.dSYM: is a directory
  rm: conftest.dSYM: is a directory
  yes
  checking for sys/types.h... yes
  checking for sys/stat.h... yes
  checking for stdlib.h... yes
  checking for string.h... yes
  checking for memory.h... yes
  checking for strings.h... yes
  checking for inttypes.h... yes
  checking for stdint.h... yes
  checking for unistd.h... yes
  checking for stdbool.h that conforms to C99... no
  checking for _Bool... no
  checking for error_at_line... no
  checking for gcc... clang
  checking whether we are using the GNU C compiler... yes
  checking whether clang accepts -g... yes
  checking for clang option to accept ISO C89... none needed
  checking for XML_ParserCreate in -lexpat... yes
  checking udunits2.h usability... no
  checking udunits2.h presence... no
  checking for udunits2.h... no
  checking udunits2/udunits2.h usability... no
  checking udunits2/udunits2.h presence... no
  checking for udunits2/udunits2.h... no
  checking for ut_read_xml in -ludunits2... no
  configure: error: in `/private/var/folders/69/wy4n7cc10n5fg5_bc8glmms80000gn/T/RtmpuOGf6j/R.INSTALLfdd5361d965a/units':
  configure: error: 
  --------------------------------------------------------------------------------
    libudunits2.so not found!
  
    If the udunits2 library is installed in a non-standard location, use:
  
      --configure-args='--with-udunits2-lib=/usr/local/lib'
  
    for example, if the library was not found, and/or
  
      --configure-args='--with-udunits2-include=/usr/include/udunits2'
  
    if the header was not found, replacing paths with appropriate values for your
    installation. You can alternatively use the UDUNITS2_INCLUDE and UDUNITS2_LIBS
    environment variables.
  
    If udunits2 is not installed, please install it.
    It is required for this package.
  --------------------------------------------------------------------------------
  
  See `config.log' for more details
  ERROR: configuration failed for package ‘units’
  * removing ‘/usr/local/lib/R/3.5/site-library/units’
  ERROR: dependency ‘units’ is not available for package ‘sf’
  * removing ‘/usr/local/lib/R/3.5/site-library/sf’
  ERROR: dependencies ‘rgdal’, ‘sf’ are not available for package ‘tigris’
  * removing ‘/usr/local/lib/R/3.5/site-library/tigris’
  ERROR: dependencies ‘sf’, ‘tigris’, ‘units’ are not available for package ‘tidycensus’
  * removing ‘/usr/local/lib/R/3.5/site-library/tidycensus’
  
  The downloaded source packages are in
      ‘/private/var/folders/69/wy4n7cc10n5fg5_bc8glmms80000gn/T/Rtmp8iit6a/downloaded_packages’
  Warning messages:
  1: In install.packages("tidycensus") :
    installation of package ‘rgdal’ had non-zero exit status
  2: In install.packages("tidycensus") :
    installation of package ‘units’ had non-zero exit status
  3: In install.packages("tidycensus") :
    installation of package ‘sf’ had non-zero exit status
  4: In install.packages("tidycensus") :
    installation of package ‘tigris’ had non-zero exit status
  5: In install.packages("tidycensus") :
    installation of package ‘tidycensus’ had non-zero exit status
  </code></pre>