I have read a 10 band .nc file into R using *open.ncdf* and
*get.var.ncdf*and I've read each band into a raster format e.g.
*raster(data[,,1])*. I used *aggregate* to upscale the data, and now I want
to write it back out to netcdf format. For some reason, I can write each
band out separately (e.g. *writeRaster(newdataband1, "newdataband1",
format="CDF")* but if I *stack* the data first, I get an error when I try to
write the stack out to netcdf. The error says "*CDF is not a supported file
format. See writeFormats()"*. Sure enough, *writeFormats()* gives me a long
list of formats that are enabled, and CDF is not in the list.

?

I am running R (R 2.11.1 GUI 1.34 Leopard build 64-bit (5589)) on Mac OS X
(10.6.4) with up-to-date packages of ncdf and Raster. I've also installed
netcdf through MacPorts and the libraries are in /opt/local rather than
/usr/local (I'm wondering if I have a library or path problem?)

How can I get the writeRaster to add CDF to the list of writeFormats?

Is there another way to reconstruct this netcdf file from the 10 raster
layers in R? (*create.ncdf*?) Alternatively, since I think I have them
written out to separate netcdfs I could maybe bind them back together using
another utility outside of R?

Thanks in advance.

Elizabeth
____________________
Elizabeth Crisfield
Research Assistant
Geography Department
Penn State University
phone 814-777-3395
ea...@psu.edu
www.elizabethcrisfield.com

        [[alternative HTML version deleted]]

_______________________________________________
R-sig-Geo mailing list
R-sig-Geo@stat.math.ethz.ch
https://stat.ethz.ch/mailman/listinfo/r-sig-geo

Reply via email to