Skip to content

StackRaster problem

2 messages · Guilherme Leite, Jon Olav Skoien

#
Hi,

This is the process I want to do:
sep=''), pattern='grd', full.names=TRUE )
[1] "d:/temp/Rtmp8Mttik/Rinst1fe4202d2ea5/dismo/ex/bio1.grd"
[2] "d:/temp/Rtmp8Mttik/Rinst1fe4202d2ea5/dismo/ex/bio12.grd"
[3] "d:/temp/Rtmp8Mttik/Rinst1fe4202d2ea5/dismo/ex/bio16.grd"
[4] "d:/temp/Rtmp8Mttik/Rinst1fe4202d2ea5/dismo/ex/bio17.grd"
[5] "d:/temp/Rtmp8Mttik/Rinst1fe4202d2ea5/dismo/ex/bio5.grd"
[6] "d:/temp/Rtmp8Mttik/Rinst1fe4202d2ea5/dismo/ex/bio6.grd"
[7] "d:/temp/Rtmp8Mttik/Rinst1fe4202d2ea5/dismo/ex/bio7.grd"
[8] "d:/temp/Rtmp8Mttik/Rinst1fe4202d2ea5/dismo/ex/bio8.grd"
[9] "d:/temp/Rtmp8Mttik/Rinst1fe4202d2ea5/dismo/ex/biome.grd"
class : RasterStack
dimensions : 192, 186, 35712, 9 (nrow, ncol, ncell, nlayers)
resolution : 0.5, 0.5 (x, y)
extent : -125, -32, -56, 40 (xmin, xmax, ymin, ymax)
coord. ref. : +proj=longlat +datum=WGS84 +ellps=WGS84 +towgs84=0,0,0
names : bio1, bio12, bio16, bio17, bio5, bio6, bio7, bio8, biome
min values : -23, 0, 0, 0, 61, -212, 60, -66, 1
max values : 289, 7682, 2458, 1496, 422, 242, 461, 323, 14

But what happen is:
sep=''), pattern='grd', full.names=TRUE )
[1] "d:/temp/Rtmp8Mttik/Rinst1fe4202d2ea5/dismo/ex/bio1.grd"
[2] "d:/temp/Rtmp8Mttik/Rinst1fe4202d2ea5/dismo/ex/bio12.grd"
[3] "d:/temp/Rtmp8Mttik/Rinst1fe4202d2ea5/dismo/ex/bio16.grd"
[4] "d:/temp/Rtmp8Mttik/Rinst1fe4202d2ea5/dismo/ex/bio17.grd"
[5] "d:/temp/Rtmp8Mttik/Rinst1fe4202d2ea5/dismo/ex/bio5.grd"
[6] "d:/temp/Rtmp8Mttik/Rinst1fe4202d2ea5/dismo/ex/bio6.grd"
[7] "d:/temp/Rtmp8Mttik/Rinst1fe4202d2ea5/dismo/ex/bio7.grd"
[8] "d:/temp/Rtmp8Mttik/Rinst1fe4202d2ea5/dismo/ex/bio8.grd"
[9] "d:/temp/Rtmp8Mttik/Rinst1fe4202d2ea5/dismo/ex/biome.grd"
Error in rep.int(names(x), lapply(x, length)) : invalid 'times' value

Do you know how to fix it?

Thank you,
Guilherme
#
Did you attach the raster package with library(raster)? It seems the 
newest version of dismo does not depend on raster, so you will not be 
able to use raster-functions if you only attach dismo.
This error message typically comes when R tries to use 
utils:::stack.default instead of the stack-function defined in the 
raster-package.

If this is not the case, please give the output from sessionInfo().

Cheers,
Jon
On 8/26/2014 3:21 PM, Guilherme Leite wrote: