I've got a problem fighting one error. Here is the line I try to execute:
library(vegan)
adonis(data = dset, adiv ~ N+P+K)
It returns a failure message:
Error in rowSums(x, na.rm = TRUE) :
'x' must be an array of at least two dimensions
Everything seems to be alright with the dataset, because aov(data = dset, adiv ~ N+P+K) works just fine. I know that such errors appear when some functions drop data frame dimensions, but I don't know how to fix it in this case.
Edit. Adding a piece of my dataset.
treatment N P K M adiv
N 1 0 0 0 0.2059
P 0 1 0 0 0.20856
K 0 0 1 0 0.22935
O 0 0 0 0 0.10729
NP 1 1 0 0 0.30674
NK 1 0 1 0 0.30509
PK 0 1 1 0 0.30606
NPK+ 1 1 1 1 0.50389
NPK 1 1 1 0 0.40731
manure 0 0 0 1 0.2085
Before I try to execute adonis I convert treatment values into factors with:
dataset$N <- as.factor(dat$N)
dataset$P <- as.factor(dat$P)
dataset$K <- as.factor(dat$K)
dataset$M <- as.factor(dat$M)
Then I just try to execute the function and get the error. As I've already mentioned, everything works just fine when I try aov() or lm().