df2vegtable | R Documentation |
Conversion of a data frame containing a cross table of abundance or cover of species in single plots.
This function coerces a data frame containing a vegetation cross table into
a vegtable object. The input data frame x
may include information
on the layers or not.
df2vegtable(x, species, layer, ...)
## S4 method for signature 'data.frame,numeric,numeric'
df2vegtable(x, species, layer, ...)
## S4 method for signature 'data.frame,numeric,missing'
df2vegtable(x, species, layer, ...)
x |
A data frame formatted for a taxlist object. |
species |
Numeric or integer indicating the position of the column with species names. |
layer |
Numeric or integer indicating the position of the column with layers. |
... |
Further arguments passed from or to other methods. |
A vegtable object.
Miguel Alvarez kamapu78@gmail.com
## Creating data set 'dune_veg'
library(vegan)
## Load data from vegan
data(dune)
data(dune.env)
## Conversion to vegtable
dune_veg <- data.frame(
species = colnames(dune), t(dune),
stringsAsFactors = FALSE, check.names = FALSE
)
dune_veg <- df2vegtable(dune_veg, species = 1)
summary(dune_veg)
## Adding environmental variables
dune.env$ReleveID <- as.integer(rownames(dune.env))
header(dune_veg) <- dune.env
summary(dune_veg)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.