[R] EOF: object needs to be "field"?

From: Jih-Wang (Aaron) Wang <aaron_at_atmos.colostate.edu>
Date: Fri 14 Jul 2006 - 14:18:12 EST

Hi, All:

I am using Chinese version of R, but I will translate the error message.

I have been trying to find out the spatial pattern of some meteorology variable. I converted the data from "grib" format to binary, which is not a big deal. Then I read in the binary data, and it has 3 dimensions: x, y, and time. The following is my code

nx <- 349
ny <- 277
nt <- 312

nRunning <- 12
missing <- -900.
datain <- readBin("PWAT-mon.197901-200412.dat",what=numeric(),n=nx*ny*nt,size=4,endian="little") datain[datain<missing] <- NA
data <- array(datain,c(nx,ny,nt))
eof.c <- EOF(data,mon=1)

Then I get the error message as follow (origionally in Chinese):

erro when there is a missing value at "if((class(fields)[2] != "monthly.field.object") & (class(fields[2] != :"

So, I tried

t1 <- data[1:nx,1:ny,1]
class(t1) <- c("field")

It still didn't work. The error message is now (origionally in Chinese)

[1] "The directory data/ does not exists.. Creates it.." error at: rep.default(NA, dims[2]) : the second argument of rep() not correct besides: Warning messages:
1: 'data' already exists
2: force the left side of the function to become an array

Can anybody help me with this? I am new to R, and I don't have a book with me. Thank you for your time.

Best Regards,
Jih-Wang (Aaron) Wang

        [[alternative HTML version deleted]]

R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Sat Jul 15 04:24:04 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Sat 15 Jul 2006 - 06:15:51 EST.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.