[R-sig-Geo] raster: stackApply problems..

Leonidas Liakos |eon|d@@_||@ko@ @end|ng |rom y@hoo@gr
Tue Nov 19 20:14:42 CET 2019


I run the example with clusterR:

no_cores <- parallel::detectCores() -1
raster::beginCluster(no_cores)
?????? res <- raster::clusterR(inp, raster::stackApply, args =
list(indices=c(2,2,3,3,1,1),fun = mean))
raster::endCluster()

And the result is:

> res
class?????????? : RasterBrick
dimensions : 180, 360, 64800, 3?? (nrow, ncol, ncell, nlayers)
resolution : 1, 1?? (x, y)
extent???????? : -180, 180, -90, 90?? (xmin, xmax, ymin, ymax)
crs?????????????? : +proj=longlat +datum=WGS84 +ellps=WGS84 +towgs84=0,0,0
source???????? : memory
names?????????? : layer.1, layer.2, layer.3
min values :???????? 1.5,???????? 3.5,???????? 5.5
max values :???????? 1.5,???????? 3.5,???????? 5.5??


layer.1, layer.2, layer.3 (?)

So what corrensponds to what?


If I run:

res2 <- stackApply(inp,c(2,2,3,3,1,1),mean)

The result is: 

> res2
class      : RasterBrick 
dimensions : 180, 360, 64800, 3  (nrow, ncol, ncell, nlayers)
resolution : 1, 1  (x, y)
extent     : -180, 180, -90, 90  (xmin, xmax, ymin, ymax)
crs        : +proj=longlat +datum=WGS84 +ellps=WGS84 +towgs84=0,0,0 
source     : memory
names      : index_2, index_3, index_1 
min values :     1.5,     3.5,     5.5 
max values :     1.5,     3.5,     5.5 

There is no consistency with the names of the output and obscure correspondence with the indices in the case of clusterR


	[[alternative HTML version deleted]]



More information about the R-sig-Geo mailing list