title: How to fix 'libproj not found in standard or given locations' error in r
body: <p>I'm trying to install the 'agricolae' package on R, but I get an error saying </p>
  
  <pre><code>    configure: error: libproj not found in standard or given locations.
      ERROR: configuration failed for package ‘sf’
      * removing ‘/R/x86_64-pc-linux-gnu-library/3.6/sf’
      Warning in install.packages :
        installation of package ‘sf’ had non-zero exit status
      ERROR: dependency ‘sf’ is not available for package ‘spdep’
      * removing ‘/R/x86_64-pc-linux-gnu-library/3.6/spdep’
      Warning in install.packages :
        installation of package ‘spdep’ had non-zero exit status
      ERROR: dependency ‘spdep’ is not available for package ‘agricolae’
      * removing ‘/R/x86_64-pc-linux-gnu-library/3.6/agricolae’
      Warning in install.packages :
        installation of package ‘agricolae’ had non-zero exit status
  </code></pre>
  
  <p>I recently upgraded to Ubuntu 18.04.2 and R version 3.6.0 (2019-04-26) -- "Planting of a Tree" and that's when the problems started.</p>
  
  <p>When I do</p>
  
  <pre><code>    $ sudo apt-get install -y libproj-dev
  </code></pre>
  
  <p>I get:</p>
  
  <pre><code>    libproj-dev is already the newest version (5.2.0-1~bionic0).
  </code></pre>