[R] Re: netCDF

Thomas Lumley tlumley at u.washington.edu
Thu Feb 14 17:52:43 CET 2002

> Now, at using it, I've found the following problem:
> > npp <- open.netCDF("npp.nc")
> > a <- read.netCDF(npp)
> Error: Can't handle NC_CHAR yet
> > summary.netCDF(npp)
> netCDF file npp.nc is open
> $types
> [1] "single" "single" "single" "single" "single" "char"   "single"
> "single"
> [9] "single"
> $dims
> etc.
> Do you plan to release a version supporting NC_CHAR soon?
> If not, would it be possible to modify the code so that the
> char variables were discarded as currently but the non-char variables
> could be read in?

I believe you should be able to just change

  case NC_CHAR:
        error("Can't handle NC_CHAR yet");

in Rreadnetcdf.c, line 234-6 to

  case NC_CHAR:
        warning("Can't handle NC_CHAR yet");
	return R_NilValue;

which would return NULL instead of the requested data.


r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch

More information about the R-help mailing list