错误再现R中的stack()示例

时间:2017-02-17 15:07:31

标签: r r-raster

当我尝试重现光栅参考手册中给出的stack()示例时,出现以下错误:

R> fn <- system.file("external/test.grd", package="raster")
R> s <- stack(fn, fn)
Error in rep.int(names(x), lengths(x)) :
  unimplemented type 'NULL' in 'rep3'

或者如果我尝试:

R> fn <- system.file("external/test.grd", package="raster")
R> r <- raster(fn)
R> s <- stack(r, fn)
Error in as.list.default(x) : 
  no method for coercing this S4 class to a vector

有人有想法吗?!

0 个答案:

没有答案