在terra包中读取多个栅格图层

7

我正在改变我的空间工作流程,使用terra包代替raster包。使用raster包时,我曾经直接将多个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个spatRasters的列表。

temp_rasters <- c(lapply(filelist_temp, rast))
1个回答

18

这比我想象的要简单

temp_rasters <- rast(filelist_temp)

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接