Skip to content

Help: Error running Projection.raster in BIOMOD

1 message · Marco

#
Dear Community:

I am running Projection.raster on my species, and got one simple error
that I had no idea why.

My running code is simply like this:
# Here is my raster stack input information:
class       : RasterStack
dimensions  : 1800, 4200, 5  (nrow, ncol, nlayers)
resolution  : 0.008333333, 0.008333333  (x, y)
extent      : 70, 105, 25, 40  (xmin, xmax, ymin, ymax)
projection  : +proj=longlat +datum=WGS84 +ellps=WGS84 +towgs84=0,0,0
min values  : -227 4125   33   11   83
max values  :   242 11533   156  2510  8469


#and the error is simply:
Error in x at layers[[i]] : subscript out of bounds

When traced the error back, I found that I am able to generate the
projection for each "g" (algorithm), but then came the error:

pile.proj <- stack(pile.proj, run.name2 = g)
#where pile.proj is a NULL stack, and g is the projection result.

Could anybody explain why?


Thanks in advance~

Sincerely

Marco