Learn R Programming

spacodiR (version 0.13.0115)

as.spacodi: converting between data formats for community phylogenetics

Description

as.spacodi converts from picante or phylocom data formats into spacodi format.

Usage

as.spacodi(data, outfile = NULL)

Arguments

data
a community dataset in phylocom or picante format
outfile
an optional text file to which to write output

Value

spacodiR

Details

This utility converts a community dataset (either from phylocom or picante (see picante) into a format interpretable by either this R-package spacodiR or the external program SPACoDi, a Windows executable (available at http://ebe.ulb.ac.be/ebe/Software.html). Note also that the community-dataset format used here is also that called for by the package vegan; see vegandocs.

phylocom format is also referred to as triplet-formatting, where plots are within the first column, abundances in the second, and species names in the third column of the dataframe. picante format is simply the transpose of spacodiR-formatting of the community dataset: in spacodiR, species are expected as the row names of the dataframe, where plots are represented as the column names. The user has the option to save an output file, defined by outfile.

See Also

as.phylocom; as.picante

Examples

Run this code
# call example data from spacodiR
data(sp.example)
attach(sp.example)
spl->d.spacodi  
d.spacodi ## SPACoDi format

# convert to phylocom
as.phylocom(data=d.spacodi, picante=FALSE)->d.phylocom
d.phylocom ## phylocom format

# convert dataset to picante
as.picante(data=d.phylocom)->d.picante
d.picante ## picante format

# convert back to SPACoDi 
as.spacodi(data=d.picante)

Run the code above in your browser using DataLab