how to install R packages “RNetCDF” and “ncdf” on Ubuntu?

后端 未结 3 951
情书的邮戳
情书的邮戳 2021-01-02 09:31

I would like to use the R packages RNetCDF and ncdf in Ubuntu.

When I try install.packages(\'RNetCDF\') or install.packages(\'ncdf\'), I ge

3条回答
  •  失恋的感觉
    2021-01-02 10:07

    In my case, libudunits2-dev package was needed.

    sudo apt-get install libudunits2-dev

    Since I installed NetCDF from source, I had to manually specify the locations of lib and include folders

    install.packages("/home/user/Downloads/RNetCDF_1.6.1-2.tar.gz", 
    repos = NULL,
    type="source",
    dependencies=FALSE,
    configure.args="--with-netcdf-include=/usr/local/netcdf-4.2.1-build/include --with-netcdf-lib=/usr/local/netcdf-4.2.1-build/lib")
    

提交回复
热议问题