[R] Specaccum

Sarah Goslee sarah.goslee at gmail.com
Wed Feb 20 14:41:14 CET 2008


You need to read the help for specaccum to see what it returns. If you
want the site and richness components, as in the example you give, you
could do:

my.sa <- specaccum(my.data)
write.table(cbind(my.sa$sites, my.sa$richness), "myoutput.csv")

Sarah

On Feb 20, 2008 7:24 AM, Alfonso Pérez Rodríguez <fonsilei at iim.csic.es> wrote:
> Hello, I'm trying to obtain a species abundance curve with the function  specaccum from vegan package. I've applied this function to my data and I've obtained something like this:
>
> Sites    1.000000 2.000000 3.000000 4.000000  5.0000000  6.0000000  7.00  Richness 6.510000 8.290000 9.150000 9.770000 10.3300000 10.7600000 sd       1.381662 1.350608 1.200799 1.117853  0.9749903  0.9333333  0.90
>
> But the problem is that I want to export this data to an excel file, or a txt file, but I'm not able to do it because I can not asign this values to a data.frame or a matrix or something. When I try to transform in a data frame the program tell me:
>
> Error en as.data.frame.default(x[[i]], optional = TRUE, stringsAsFactors = stringsAsFactors) :
>   cannot coerce class "specaccum" into a data.frame
>
> Then, what can I do? Thank you very much.
>
>
-- 
Sarah Goslee
http://www.functionaldiversity.org



More information about the R-help mailing list