如何修复';在标准或给定位置未找到libproj';r中的错误

如何修复';在标准或给定位置未找到libproj';r中的错误,r,ubuntu-18.04,R,Ubuntu 18.04,我正试图在R上安装'agricolae'软件包,但我得到一个错误,即 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 :

我正试图在R上安装'agricolae'软件包,但我得到一个错误,即

    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
我最近升级到Ubuntu 18.04.2和R版本3.6.0(2019-04-26)——“植树”,问题就从那时开始出现

当我这样做的时候

    $ sudo apt-get install -y libproj-dev
我得到:

    libproj-dev is already the newest version (5.2.0-1~bionic0).

错误表示包“sf”不可用于依赖项“spdep”。因此,您应该尝试安装pkg'sf'。(我与您和pkg:agricolae安装在同一个操作系统上,没有问题。我比您拥有更完整的spatial R和系统软件包。)

编辑:有报告称,在解决此问题时,有必要创建指向库位置的环境链接:

$ export LD_LIBRARY_PATH=/lib:/usr/lib:/usr/local/lib 

(From:它反过来链接到,其中提到了更多的调试选项。)

谢谢,我确实尝试过,但我的问题是:“配置:错误:libproj未在标准或给定位置找到。”您需要(1)记录
sessionInfo()的输出,以及(2)显示尝试从终端会话安装“sf”时发生的情况。