Elaine Kuo <elaine.kuo.tw <at> gmail.com> writes: > > Hello, > > I am using betadiver (vegan) to calculate beta diversity. > However, an error message shows > > Error in ifelse(x > 0, 1, 0) : > (list) object cannot be coerced to type 'double' ...snip...
> ## Raw data > R <- betadiver(dataR) > > ## The indices > betadiver(help=TRUE) > > ## The beta sim index (Lennon 2001) > d <- betadiver(R, "sim") > Elaine, Look carefully what you do here: betadiver needs data as input -- not beta diversities. Your last command is equal to this oneliner: d <- betadiver(betadiver(dataR), "sim") This is guaranteed to fail. Use instead d <- betadiver(dataR, "sim") Cheers, Jari Oksanen ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.