[R] Any solution to have RnetCDF, ncdf or ncdf4 in R 3.1 ?

David Winsemius dwinsemius at comcast.net
Mon Apr 7 03:17:02 CEST 2014

On Apr 6, 2014, at 4:21 PM, Marc Girondot wrote:

> Le 06/04/2014 16:47, David W. Pierce a écrit :
>> Hi Marc,
>> those packages are just interfaces to the netcdf library that must  
>> already exist on your machine. Try installing the netcdf library  
>> first, and then installing the R package.
>> You will need the development version of the netcdf library  
>> installed in order to compile the R packages. Hopefully the exact  
>> package name will be obvious in the package manager on your system.
> Thanks a lot for these infos.
> Here are the last news for my problem of installation package in 3.1:
> I have installed macport and then I have tried to install  
> development version of netcdf library:
> sudo port install netcdf-devel
> Error: Port netcdf-devel not found

Macports installs its packages in folders that are not standard and  
then R packages don't find them (at least that's my understanding of  
the reason Macports causes troubles with R packages.) You are asked  
not to use it for packages that R will be linking to. So maybe that  
error will be a boon rather than a bane. Doing a search on: [ macports  
Urbanek]  in the archive of r-sig-mac should provide further details.  
This really should have been posted there.

> The netcdf library is available in macport but not the development  
> one.
> In the meantime, I have tried to install ncdf and ncdf4 package  
> after downloading the MacosX binary versions at:
> http://cran.r-project.org/bin/macosx/contrib/r-release/ncdf_1.6.6.tgz
> http://cran.r-project.org/bin/macosx/contrib/r-release/ncdf4_1.10.tgz
> I have installed both using the install_local() function of the  
> package devtools.
> Both install and run correctly.
> The same procedure applied to RNetCDF (http://cran.r-project.org/web/packages/RNetCDF/index.html 
> ) has produced an error during installation.
> I have installed other packages in 3.1, or directly using  
> install.packages() or loading the MacosX binary and using  
> install_local(). I have still a problem with rgdal (http://cran.r-project.org/web/packages/rgdal/index.html 
> ). Probably again it is a problem of library (gdal) that is not  
> present. I will wait that binary library is available in CRAN.

GDAL is an external package. http://trac.osgeo.org/gdal/wiki/DownloadingGdalBinaries

rgdal is the R interface package that you would use to get GDAL  


David Winsemius, MD
Alameda, CA, USA

More information about the R-help mailing list