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))
library(clim.pact)
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")
EOF(t1,mon=NULL)
---------------------------------------------------------------------------------------------------------------------------
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]]