Learn R Programming

spacodiR (version 0.13.0115)

as.phylocom: converting between data formats for community phylogenetics

Description

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

Usage

as.phylocom(data, picante=FALSE, outfile = NULL)

Arguments

data
a community dataset in either spacodiR or picante format (with species as row names and plots as column names or vice versa)
picante
Boolean; if current data format is spacodi, argument should be picante=FALSE; otherwise, format is assumed to be for picante, with plots as row names
outfile
an optional text file to which to write output

Value

phylocom; note that while the R-object returned by this function has column names, if output is written to a file, the header is dropped (as appropriate for use in the external phylocom executable: http://www.phylodiversity.net/phylocom/).

Details

This utility converts a species-by-plots matrix into triplet format, which is readable by the external program phylocom. If picante=TRUE, the data are expected to be in the form used for picante (i.e., a plots-by-species matrix; picante-package). If the user selects picante=FALSE, the data are expected to be in the form used for spacodiR (i.e., a species-by-plots matrix). The user has the option to save an output file, defined by outfile.

References

WEBB CO, DD ACKERLY and SW KEMBEL. 2008. Phylocom: software for the analysis of phylogenetic community structure and trait evolution. Bioinformatics 24:2098-2100.

See Also

as.spacodi and as.picante 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 the code above in your browser using DataLab