[R-sig-eco] save vegemite{vegan} table

Roland Kaiser roland.kaiser at sbg.ac.at
Sun Jan 17 19:33:32 CET 2010


Hi Michael,

vegemite returns a list with two elements
that can be used to index sites and species.
Simply use these vectors to reorder your data set.

data(dune)
vm <- vegemite(dune, use = decorana(dune))
tb <- t(dune[vm$sites, vm$species]) # transpose matrix to have  
species as rows
write.csv(tb, "foo.csv")

HTH,

Roland

> Dear r-sig-ecology,
>
> I am attempting to save the table that prints when I run the function
> vegemite(). I would like to paste it into a spreadsheet if possible.
> Here is what I have tried.
>
>
> library(vegan)
> data(varespec)
> vege.test <- vegemite(varespec, scale="Hult")
>
> # mac method for copying to clipboard
> # replace pipe('pbcopy','w') with 'clipboard' on windows
> write.table(vege.test,pipe('pbcopy','w'), sep = "\t", col.names = NA)
>
> # I have also tried
> vege.test <- capture.output(vegemite(varespec, scale="Hult"))
> write.table(vege.test,pipe('pbcopy','w'), sep = "\t", col.names = NA)
>
> Neither of these seems to paste correctly into a spreadsheet.
> I think the problem is not the function, but that I don't understand
> how to properly work with lists ...
>
> Thanks for any suggestions,
> Michael
>
> -- 
> Michael Denslow
>
> I.W. Carpenter Jr. Herbarium [BOON]
> Department of Biology
> Appalachian State University
> Boone, North Carolina U.S.A.
> -- AND --
> Communications Manager
> Southeast Regional Network of Expertise and Collections
> sernec.org
>
> 36.214177, -81.681480 +/- 3103 meters
>
> _______________________________________________
> R-sig-ecology mailing list
> R-sig-ecology at r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-ecology



More information about the R-sig-ecology mailing list