Skip to content

NetCDF and raster on MAC

2 messages · steven mosher, Robert J. Hijmans

#
Steven,

The current version of raster (1.3-11 on CRAN) uses 'ncdf' rather then
'RNetCDF'.  The 'ncdf' package is available for OSX.

Then, for a single layer:

r = raster('file.nc')
r = raster('file.nc', band=10)

For all layers:

b = brick('file.nc')

You may get a warning about the variable that was selected. You can
avoid that by explicitly setting the variable you want with the
varname="  " argument, e.g.,

b = brick('file.nc', varname='temperature')

I cannot copy to r-sig-mac, as I am not subscribed to it (that's why
it is bad practice to send a single message to two mailing lists).

Hth, Robert
On Sun, Aug 22, 2010 at 12:14 PM, steven mosher <moshersteven at gmail.com> wrote: