[R] problem with creating a netcdf file under script sh
Tu Anh Tran
tuanhtr82 at yahoo.com
Thu Apr 9 10:53:45 CEST 2009
Hi everyone,
I try to make a netcdf file which disposes a difference between 2 variables of 2netcdf files same dimension
When I programmed under R, everything is ok but when I put the code under EOF of a sh script, an error occurs:
"Error, passed variable has a dim that is NOT of class dim.ncdf!". My programme is:
x1<-open.ncdf("file1.nc")
x2<-open.ncdf("file2.nc")
y1<-get.var.ncdf(x1,"a")
y2<-get.var.ncdf(x2,"a")
y<- y1-y2
t<-var.def.ncdf("t",units="c",dim=x1$dim,-1)
nc<-create.ncdf("test.nc",vars=t)
put.var.ncdf(nc,t,y)
close.ncdf(nc)
Thanks in advance,
T.A
More information about the R-help
mailing list