简体   繁体   English

在 terra package 中读取多个栅格

[英]Reading in multiple rasters in terra package

I'm changing my spatial workflow to use the terra package instead of the raster package.我正在更改我的空间工作流程以使用 terra package 而不是光栅 package。 With the raster package I used to read in multiple rasters directly into a stack.使用光栅 package 我曾经将多个光栅直接读入堆栈。

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)

Is there a simple way to do the same operation in terra?是否有一种简单的方法可以在 terra 中执行相同的操作?

This is what I came up with initially, but it doesn't work.这是我最初想出的,但它不起作用。 I end up with a list of 25 spatRasters我最终得到了 25 个 spatRasters 的列表

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

It's simpler than I realized这比我意识到的要简单

temp_rasters <- rast(filelist_temp)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM