as.phylocom: converting between data formats for community phylogenetics

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/dataManipulation.R

Description

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

Usage

1
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

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.

Value

A named array, formatted for use in 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/).

Author(s)

Jonathan Eastman

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
# 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)

spacodiR documentation built on May 2, 2019, 8:26 a.m.