[英]R: How to use “stack” instead of “stack” (from raster package)?
我想在基數R中使用stack
函數,如我先前問題的答案所示。 但是,我也在使用raster
包(它還包含一個stack
函數),並且此包始終檢索錯誤:
Error in (function (classes, fdef, mtable) :
unable to find an inherited method for function ‘raster’ for signature ‘"numeric"’
有沒有辦法將包分配給功能? 還是一個想法,如何在基本R中而不是在光柵包中使用堆棧功能?
這是我先前問題的可重現示例:
library(raster)
group1 <- c(101, 106)
group2 <- c(102, 104)
group3 <- c(105, 103)
S <- stack(list(group1 = group1, group2 = group2, group3 = group3))
感謝您的想法。
您可以使用前綴utils::
這樣的
S <- utils::stack(list(group1 = group1, group2 = group2, group3 = group3))
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.