[R-sig-Geo] error stacking rasters from list in R on Linux

joke atuge jazzpriestess2000 at yahoo.com
Mon Jul 20 18:31:22 CEST 2015


 Hello I am having issues stacking my rasters from list before I create raster time series. When I do this directly in the R environment using sample data, it works out fine. However, once I send it in as a script to run on the HPC I get the following error:Error in x[[1]] : subscript out of bounds
Calls: stack -> stack -> .local
Execution halted
THe codes prior to this error are: FunR<-function(r){
ext<-raster(extent(r),nrow=1100,ncol=1100)
crs(ext)<-crs(r)
D<-rasterize(r,ext,field="LFRP")
EC<-extent(-20, 60,0,30)
 D2<-extend(D,EC)
D3<-crop(D2,extent(-18,20,2,30))
s <- raster(nrow=600, ncol=1000,extent(-18,20,2,30))
crs(s)<-crs(WA)
Ds <- resample(D3, s, method='bilinear')
 crs(Ds)<-crs(WA)
Ds}
 ###Create rasters and crop
DL4<-sapply(DL3,FunR)
DL5<-stack(DL4) .... (error occurs after this line)
How do I get ride of this, please? In addition, how do I get rid of files on my list that are totally NA. I suspect this may be an issue too.Regards,Ajoke
	[[alternative HTML version deleted]]



More information about the R-sig-Geo mailing list