簡體   English   中英

如何在 R 中已經有一些光柵文件的光柵堆棧中添加更多光柵?

[英]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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM