[英]How can I add more raster to a stack of raster that already has some raster files in R?
我有一個名為rstack
的光柵堆棧:
rstack <- list.files(path) #path contains the location of the directory
現在我有另一個名為araster
光柵文件。
如何將這個新的柵格araster
添加到堆棧rstack
?
我花了很多時間在網上搜索這個,但無濟於事。
您可以使用addLayer
函數將新光柵文件添加到現有堆棧中。
library(raster)
rstack <- addLayer(rstack,araster)
不確定我是否正確地關注了您的問題,但是如果您只是想將兩個堆棧結合起來,它應該只與c
。
rstack <- list.files()
newstack <- list.files()
combined_stack <- c(rstack, newstack)
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.