[R] help
Marco Antonio Pérez
m@rko@lun@13 @ending from gm@il@com
Fri Aug 10 16:00:33 CEST 2018
I am trying to write a function to make a matrix of precipitation with
this secuencie;
######## PRIMER PERIODO
cordex1 <-
nc_open("pr_CAM-44i_ICHEC-EC-EARTH_rcp45_r12i1p1_SMHI-RCA4_v1_mon_200601-201012.nc")
fullmon1<-ncvar_get(cordex1,"pr")
lat<-ncvar_get(cordex1,"lat", start=c(35.5),count=c(20))
lon <-ncvar_get(cordex1,"lon", start=c(125),count=c(21.5))
t <- ncvar_get(cordex1,"time")
nlon <- dim(lon)
nlat <- dim(lat)
nt <- dim(t)
fulldatav <- as.vector(fullmon1)
fulldata <- matrix(fulldatav, nrow=nlon*nlat, ncol=nt)
lonlat <- expand.grid(lon,lat)
df_cordex1<- data.frame(lonlat,fulldata)
but with the expresion fulldata <- matrix(fulldatav, nrow=nlon*nlat,
ncol=nt) this error appears
Warning message:
In matrix(fulldatav, nrow = nlon * nlat, ncol = nt) :
data length [1378620] is not a sub-multiple or multiple of the number of
rows [420]
Somebody help me!!!
[[alternative HTML version deleted]]
More information about the R-help
mailing list