as.phylocom
converts from spacodi
or picante
data formats into phylocom
format.as.phylocom(data, picante=FALSE, outfile = NULL)
spacodi
, argument should be picante=FALSE
; otherwise, format is assumed to be for picante
, with plots as row namesphylocom
; 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/).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
.
as.spacodi
and as.picante
for converting between phylocom
and SPACoDi
formats; see picante-package
for an R-port of phylocom
# 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