Donate. I desperately need donations to survive due to my health

Get paid by answering surveys Click here

Click here to donate

Remote/Work from Home jobs

How to install package ncdf4 in instance of Google Compute Engine VM RStudio?

After creating an instance of a VM using googleComputeEngineR

How do I get the ncdf4 package installed on a VM Rstudio instance?
This is the code generated from using Tools>Install packages...>

install.packages("/tmp/RtmprmX1wu/downloaded_packages/ncdf4_1.16.tar.gz", repos = NULL, type = "source")

Installing package into ‘/usr/local/lib/R/site-library’
(as ‘lib’ is unspecified)
* installing source package ‘ncdf4’ ...
** package ‘ncdf4’ successfully unpacked and MD5 sums checked
configure.ac: starting

checking for nc-config... no

Error, nc-config not found or not executable. This is a script that comes with the
netcdf library, version 4.1-beta2 or later, and must be present for configuration
to succeed.

If you installed the netcdf library (and nc-config) in a standard location, nc-config
should be found automatically. Otherwise, you can specify the full path and name of
the nc-config script by passing the --with-nc-config=/full/path/nc-config argument
flag to the configure script. For example:

./configure --with-nc-config=/sw/dist/netcdf4/bin/nc-config

Special note for R users:

To pass the configure flag to R, use something like this:

R CMD INSTALL --configure-args="--with-nc-config=/home/joe/bin/nc-config" ncdf4

where you should replace /home/joe/bin etc. with the location where you have

installed the nc-config script that came with the netcdf 4 distribution.

ERROR: configuration failed for package ‘ncdf4’
* removing ‘/usr/local/lib/R/site-library/ncdf4’
Warning in install.packages :
installation of package
‘/tmp/RtmprmX1wu/downloaded_packages/ncdf4_1.16.tar.gz’ had non-zero exit status

I think I need to change "/usr/local/lib/R/site-library"

But to what?

Or is it that I need to do something with config?

(sorry can't load a library to get the result nicely formatted either)

Comments