title: Problems Installing rgeos and rgdal on Mac OS X High Sierra
body: <p>I have looked at the multiple sources to figure out how to install <code>rgeos</code> and <code>rgdal</code> on Mac OS X High Sierra in a way that works with Anaconda Navigator. I mention Anaconda because I want to be able to build static project-specific, package environments to ensure that my projects work 6 months from now when the dependent packages change. I have successfully installed and used both <code>rgeos</code> and <code>rgdal</code> on a couple other computers but seem to be having issues on a new computer. I want to launch Shiny apps from Anaconda Navigator's RStudio. None of the solutions I found, listed below, worked:</p>
  
  <ul>
  <li><a href="https://dyerlab.ces.vcu.edu/2015/03/31/install-rgeos-on-osx/" rel="nofollow noreferrer">https://dyerlab.ces.vcu.edu/2015/03/31/install-rgeos-on-osx/</a></li>
  <li><a href="https://cran.rstudio.com/web/packages/rgeos/rgeos.pdf" rel="nofollow noreferrer">https://cran.rstudio.com/web/packages/rgeos/rgeos.pdf</a></li>
  <li><a href="http://tlocoh.r-forge.r-project.org/mac_rgeos_rgdal.html" rel="nofollow noreferrer">http://tlocoh.r-forge.r-project.org/mac_rgeos_rgdal.html</a></li>
  <li><a href="https://anaconda.org/conda-forge/r-rgdal" rel="nofollow noreferrer">https://anaconda.org/conda-forge/r-rgdal</a></li>
  </ul>
  
  <p>Based on the above sources and my slow progression through a series of error messages, I tried the following:</p>
  
  <ol>
  <li>Install GDAL 2.2 Complete [30.0 MiB] 2018-3-10 from <a href="http://www.kyngchaos.com/software/frameworks" rel="nofollow noreferrer">http://www.kyngchaos.com/software/frameworks</a>. This installs GDAL, GEOS, PROJ, SQLite and UnixImageIO frameworks.</li>
  </ol>
  
  <p>The above installed without an error message. But attempting to install rgeos gave an error message: </p>
  
  <p><code>configure: error: geos-config not found or not executable.</code></p>
  
  <p>Consequently, either the install failed and didn't notify me, or there is some type of <code>$PATH</code> issue (?). On a blog, someone suggested to do the following in response to the aforementioned issue:</p>
  
  <ol start="2">
  <li><code>brew install geos</code></li>
  </ol>
  
  <p>The above completed successfully. So I went into RStudio and tried the following, which resolved the former error but produced a new one:</p>
  
  <ol start="3">
  <li><blockquote>
    <p>install.packages("~/Downloads/rgeos_0.3-28.tar.gz", repos = NULL, type = "source")</p>
  </blockquote>
  
  <p>installing <em>source</em> package ‘rgeos’ ...
  configure: CC: x86_64-apple-darwin13.4.0-clang
  configure: CXX: x86_64-apple-darwin13.4.0-clang++
  configure: rgeos: 0.3-28
  checking for /usr/bin/svnversion... yes
  cat: inst/SVN_VERSION: No such file or directory
  configure: svn revision: 
  checking for geos-config... /usr/local/bin/geos-config
  checking geos-config usability... yes
  configure: GEOS version: 3.6.2
  checking geos version at least 3.2.0... yes
  checking geos-config clibs... yes
  checking geos_c.h  presence and usability... no
  configure: error: geos_c.h not found in standard or given locations.
  ERROR: configuration failed for package ‘rgeos’
  removing ‘/Users/aloha2018/anaconda2/lib/R/library/rgeos’
  Warning in install.packages :
    installation of package ‘/Users/aloha2018/Downloads/rgeos_0.3-28.tar.gz’ had non-zero exit status</p></li>
  </ol>
  
  <p>Any ideas on what to try next? </p>
  
  <p>Naturally, I already tried in an RStudio application launched from Anaconda Navigator:</p>
  
  <p><code>install.packages("rgeos")</code>
  <code>install.packages("rgdal")</code></p>
  
  <p>both from CRAN and from tar.gz. But it seems like it is unable to find a file called <code>geos_c.h</code>, which does indeed exist on my computer at:</p>
  
  <p><code>/Library/Frameworks/GEOS.framework/Versions/3B/Headers/geos_c.h</code></p>
  
  <p>Is there a way to tell RStudio to look in the directory containing that file so my <code>rgeos</code> and <code>rgdal</code> installations work? Are there other errors I should expect to encounter and if so, how do I avoid/resolve them?</p>
  
  <p>I also tried in a Terminal window: </p>
  
  <p><code>conda install -c conda-forge r-rgdal</code></p>
  
  <p>but that fails after spending a long time attempting to "solve environment":</p>
  
  <pre><code>Andrews-MacBook-Pro:~ aloha2018$ conda install -c conda-forge r-rgdal 
  Solving environment: failed
  
  UnsatisfiableError: The following specifications were found to be in conflict:
    - r-rgdal
    - rstudio==1.1.423
  Use "conda info &lt;package&gt;" to see the dependencies for each package.
  </code></pre>
  
  <p>So I try:</p>
  
  <p><code>conda r-rgdal</code></p>
  
  <p>But there is no output:</p>
  
  <pre><code>Andrews-MacBook-Pro:~ aloha2018$ conda info r-rgdal
  Andrews-MacBook-Pro:~ aloha2018$ 
  </code></pre>