Learn R Programming

spacodiR (version 0.13.0115)

as.picante: converting between data formats for community phylogenetics

Description

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

Usage

as.picante(data, outfile = NULL)

Arguments

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

Value

picante

Details

This utility converts a community dataset (either from phylocom or spacodiR) into a format interpretable by picante (see picante-package). 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. The user has the option to save an output file, defined by outfile. SPACoDi format is similar to that for picante, where dataframes between these packages are transposed. SPACoDi format should have species as row names.

See Also

as.spacodi and as.phylocom for converting between phylocom and SPACoDi formats; see picante-package for an R-port of phylocom

Examples

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

# convert to phylocom
as.phylocom(data=spl, 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 standardized effect size mean nearest taxon distances in picante
ses.mntd(as.picante(spl), cophenetic(phy))

Run the code above in your browser using DataLab