在r中读取多重栅格
我正在尝试阅读R中的多个栅格文件,我使用了两种方法: 1 allrasters1< - lapply(rastlist,raster)
2 allrasters2< - stack(rastlist)
在两种情况下,我都遇到了相同的错误 1
我尝试了以下解决方案: 1 更新软件包 2 重新安装R(最新版本) 但是他们都没有工作!
这是完整的代码:
library(sp)
library(raster)
library(rgdal)
rastlist <- list.files(path = "D:\\Learn\\R\\Clip\\rasters", pattern='.tif',
all.files=TRUE, full.names=FALSE)
allrasters1 <- lapply(rastlist, raster)
allrasters2 <- stack(rastlist)
I am trying to read multiple raster files in r I used two methods:
1 allrasters1 <- lapply(rastlist, raster)
2 allrasters2 <- stack(rastlist)
in the both cases I got the same error 1
I tried the following solutions:
1 update the packages
2 re-install r (latest version)
but none of them work !!
here is the full code:
library(sp)
library(raster)
library(rgdal)
rastlist <- list.files(path = "D:\\Learn\\R\\Clip\\rasters", pattern='.tif',
all.files=TRUE, full.names=FALSE)
allrasters1 <- lapply(rastlist, raster)
allrasters2 <- stack(rastlist)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论