在terra包中读取多个栅格

我正在更改我的空间工作流程以使用 terra 包而不是 raster 包。使用光栅包,我曾经将多个光栅直接读入堆栈。

filelist_temp <- list.files(datapath("Climate/World Clim 1 yr Monthly Weather/LCC June and July/June"), full.names = TRUE)
temp_rasters <- stack(filelist_temp)

有没有一种简单的方法可以在 terra 中进行相同的操作?

这是我最初想到的,但它不起作用。我最终得到了一个包含 25 个 spatRaster 的列表

temp_rasters <- c(lapply(filelist_temp, rast))

回答

它比我意识到的要简单

temp_rasters <- rast(filelist_temp)


以上是在terra包中读取多个栅格的全部内容。
THE END
分享
二维码
< <上一篇
下一篇>>