[R-sig-eco] adonis: error in rowSums

Ivailo ubuntero.9161 at gmail.com
Thu Feb 9 09:43:53 CET 2012


On Wed, Feb 8, 2012 at 4:10 PM, Caroline Wallis <c.wallis at worc.ac.uk> wrote:
> I am trying to use the 'adonis' function in the 'vegan' package to assess differences in water depth and water velocity between areas of a river channel categorised by surface flow type (6 types in total, unequal sample sizes).
>
> Sample Data (LB):
>
> SFT     Depth   Vel
> BSW     0.18    1.2
> BSW     0.16    1.03
> BSW     0.16    0.98
> BSW     0.22    0.53
> BSW     0.11    0.668
> BSW     0.14    0.432
> BSW     0.12    0.391
> BSW     0.16    0.647
> BSW     0.2     0.903
> BSW     0.3     0.594
> BSW     0.37    0.429
> ....
>
> The dependent data was used in data frame format, rather than a dissimilarity matrix.
>
> Using the call 'adonis(formula=SFT~Depth*Vel,data=LB,permutations=999,method="canberra",strata=NULL)' I get the following error:

Dear Caroline,

on a second thought I realized that you might want to flip  the
variables in your adonis() call so that "Depth" and "Vel" are the
dependent variables and "SFT" the predictor.

Something like:

# create a dataframe containing the dependent variables; "sampledata"
is the data frame you posted a sample of
dep.var <- data.frame(sampledata[,2:3])

# extract the predictor variable
pred.var <- sampledata[,1]

# perform MANOVA
model <- adonis(dep.var ~ pred.var, permutations = 999,method =
"canberra", strata = NULL)

Hope this helps,
Ivailo
-- 
UBUNTU: a person is a person through other persons.



More information about the R-sig-ecology mailing list