/packages/archive/2010/04.2010/04.30.2010/spacodi/man/as.picante.Rd
Unknown | 47 lines | 34 code | 13 blank | 0 comment | 0 complexity | c5d688df64080d20dfe235af0bc87a66 MD5 | raw file
1\name{as.picante} 2 3\alias{as.picante} 4 5\title{converting between data formats for community phylogenetics} 6 7\usage{as.picante(data, outfile = NULL)} 8 9\arguments{ 10 \item{data}{a community dataset in \code{phylocom} or \code{spacodi} format} 11 \item{outfile}{an optional text file to which to write output} 12} 13 14\details{This utility converts a community dataset (either from \code{phylocom} or \pkg{spacodi}) 15into a format interpretable by \pkg{picante} (see \code{\link[picante]{picante-package}}). \code{phylocom} format is also referred 16to as \code{triplet}-formatting, where plots are within the first column, abundances in the second, and species names in the 17third column of the dataframe. The user has the option to save an output file, defined by \code{outfile}. \code{SPACoDi} format is 18similar to that for \pkg{picante}, where dataframes between these packages are transposed. \code{SPACoDi} format should have species as row names. 19} 20 21\value{An array, formatted for use in \code{picante}} 22 23\author{Jonathan Eastman} 24 25\seealso{\code{\link{as.spacodi}} and \code{\link{as.phylocom}} for converting between \code{phylocom} 26and \code{SPACoDi} formats; see \code{\link[picante]{picante-package}} 27for an R-port of \code{phylocom}} 28 29\examples{ 30# call example data from SPACoDi 31data(sp.example) 32attach(sp.example) 33sp.plot->d.spacodi 34d.spacodi ## SPACoDi format 35 36# convert to phylocom 37as.phylocom(data=sp.plot, picante=FALSE)->d.phylocom 38d.phylocom ## phylocom format 39 40# convert dataset to picante 41as.picante(data=d.phylocom)->d.picante 42d.picante ## picante format 43 44# convert back to SPACoDi 45as.spacodi(data=d.picante) 46 47}