Re: [R] Function for translation of a list into a matrix as used byordination?

From: Christos Hatzis <christos.hatzis_at_nuverabio.com>
Date: Fri, 25 Jan 2008 16:59:17 -0500

Take a look at ?reshape - it is used to convert between 'long' and 'wide' formats of data tables (frames).

-Christos

> -----Original Message-----
> From: r-help-bounces_at_r-project.org
> [mailto:r-help-bounces_at_r-project.org] On Behalf Of
> Billy_Schweiger_at_nps.gov
> Sent: Friday, January 25, 2008 4:30 PM
> To: r-help_at_r-project.org
> Subject: [R] Function for translation of a list into a matrix
> as used byordination?
>
>
> Hello.
>
> Does anyone know of an existing function that takes a list in
> the form of:
>
> Plot1 Species1 Abundance1
> Plot1 Species2 Abundance2
> Plot2 Species1 Abundance1
> Plot2 Species3 Abundance3
> .
> .
> .
> PlotN SpeciesN AbundanceN
>
> and translates into a matrix in the form of
>
> Species1 Species2.... SpeciesN
> Plot1 Abundance1 Abundance2... AbundanceN
> Plot2 Abundance1 Abundance2... AbundanceN
> .
> .
>
> .
> PlotN AbundanceN AbundanceN... AbundanceN
>
>
> This is a basic operation used in the initial stages of
> ordination etc of ecological data (vegetation or other
> species) that is usually stored in a database or flatfile in
> the list format above. It is similar to a cross tabulation
> like the function xtabs(), however its useful to be able to
> control whether a measured abundance for a taxa is included
> or a boolean
> (presence/absence) for the taxa in a given plot.
>
> Im new to such analyses in R, but before writing it myself
> hope or suspect that such a function or library is out there
> (although I dont see it after some quick searching in things
> like Vegan or BiodivesityR or labdsv).
>
>
> Thanks
> billy
>
> ______________________________________________
> R-help_at_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.
>
>



R-help_at_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. Received on Fri 25 Jan 2008 - 22:01:56 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Fri 25 Jan 2008 - 22:30:08 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive