/packages/archive/2010/04.2010/04.20.2010/spacodi/man/as.spacodi.Rd

http://github.com/eastman/spacodiR · Unknown · 38 lines · 26 code · 12 blank · 0 comment · 0 complexity · 38690a243cddbf490863183fe7f23dd8 MD5 · raw file

  1. \name{as.spacodi}
  2. \alias{as.spacodi}
  3. \title{converting between data formats for community phylogenetics}
  4. \usage{as.spacodi(data, outfile = NULL)}
  5. \arguments{
  6. \item{data}{a species-by-plots matrix}
  7. \item{outfile}{an optional text file to which to write output}
  8. }
  9. \details{This utility converts a species-by-plots matrix into a format readable by the external program \code{SPACoDi}, a Windows executable.
  10. The user has the option to save an output file, defined by \code{outfile}.
  11. }
  12. \value{an array, formatted for use in \code{SPACoDi} for Windows}
  13. \author{Jonathan Eastman}
  14. \seealso{\code{\link{as.phylocom}} for converting between \code{phylocom} and \code{SPACoDi} formats;
  15. see \code{\link{spacodi.calc}} for community diversity measures of empirical data}
  16. \examples{
  17. # generate a species-by-plots matrix
  18. foo <- r.plot(species=10,plots=6,missing.prop=0.15,sim.tree=FALSE)
  19. # convert to phylocom format
  20. as.phylocom(foo) -> p.foo
  21. p.foo
  22. # convert back to spacodi format and write to file
  23. as.spacodi(p.foo, outfile="spacodi.formatted.txt") -> s.foo
  24. s.foo # re-converted SPACoDi dataset
  25. foo # comparison with the original dataset
  26. }