/packages/archive/2010/04.2010/04.30.2010/spacodi/man/as.picante.Rd

http://github.com/eastman/spacodiR · Unknown · 47 lines · 34 code · 13 blank · 0 comment · 0 complexity · c5d688df64080d20dfe235af0bc87a66 MD5 · raw file

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