Codyn-multivariate_change错误。如何过滤具有多个物种记录的重复项?

时间:2019-02-10 22:03:37

标签: r data-manipulation

我试图在我的数据集(下面发布的代码和数据集示例)上使用Codyn包和函数multivariate_change()。我需要解决多条记录错误。

library(codyn)
multivariate_change(df, 
                    time.var="time", 
                    replicate.var = "replicate", 
                    species.var = "species", 
                    abundance.var = "abundance")


Error in check_single(df, species.var, time.var = time.var, replicate.var = replicate.var) : 
  Multiple records for one or more species found at:
 time   replicate
 "2.2017" "111"     
 "2.2013" "135"     
 "2.2014" "135"  etc.etc.

structure(list(replicate2 = c("2163", "2164", "2171", "2199", "2233", 
"2234", "2235", "236", "2426", "2427", "2430"), UKX = c("8145700", 
"8145700", "8143625", "1100925", "1100925", "1100925", "1100925", 
"8143625", "3315425", "3315425", "3418450"), Date = c(1189987200, 
1189987200, 1188950400, 1190246400, 1188259200, 1188259200, 1188345600, 
906336000, 1220400000, 1220400000, 1220313600), time = c(3.2007, 
3.2007, 3.2007, 3.2007, 2.2007, 2.2007, 2.2007, 3.1998, 3.2008, 
3.2008, 3.2008), replicate = c("234", "331", "57", "336", "336", 
"336", "342", "57", "356", "313", "157"), species = c("A", "A", 
"A", "A", "A", "A", "A", "A", "A", "A", "A"), abundance = c(0, 0, 
0, 0, 0, 0, 0, 0, 0, 0, 0), Time2 = c(25, 25, 25, 25, 8, 8, 8, 
20, 26, 26, 26)), row.names = 100:110, class = "data.frame")

0 个答案:

没有答案