我有一些来自毒性试验的数据。我的反应变量是Plutei
,这是收集的正常形状幼虫(6个重复)的数量:
我用以下方法治疗了这只幼虫:
我想评估每个因素(及其相互作用)在我测量的Plutei
响应中的重要性,我想用adonis
中的vegan
函数来做包,版本2.2-1。
我已经创建了这样一个数据框:
Time Species Site Metal Concentration Plutei Replicates
T1 Paracentrotus Antignano Zn 60 78 1
T1 Paracentrotus Antignano Zn 60 78 2
T1 Paracentrotus Antignano Zn 60 77 3
T1 Paracentrotus Antignano Zn 60 80 4
T1 Paracentrotus Antignano Zn 60 80 5
T1 Paracentrotus Antignano Zn 60 79 6
T1 Paracentrotus Antignano Zn 70 70 1
T1 Paracentrotus Antignano Zn 70 69 2
T1 Paracentrotus Antignano Zn 70 70 3
T1 Paracentrotus Antignano Zn 70 71 4
这是str(mydata)
:
str(mydata) 'data.frame': 3241 obs. of 7 variables:
$ Time : Factor w/ 6 levels "T1","T2","T3",..: 6 1 1
$ Species : Factor w/ 3 levels "Arbacia","Paracentrotus",..: 3 2
$ Site : Factor w/ 4 levels "Antignano","Chioma",..: 4 1
$ Metal : Factor w/ 4 levels "Cd","Cu","Metal",..: 3 4
$ Concentration: Factor w/ 23 levels "100","100/70",..: 23 15 1
$ Plutei : Factor w/ 90 levels "0","1","10","11",..: 90 77 77 76
$ Repl : Factor w/ 7 levels "1","2","3","4",..: 7 1 2 3 4 5 6 1 2 3 ...
当我尝试运行adonis
函数时,
perm <- adonis(Plutei ~ Time * Species * Site * Metal, data = mydata, permutations = 999)
我收到此消息:
Error in rowSums(x, na.rm = TRUE) :
'x' must be an array of at least two dimensions
我做错了什么?