transpose | R Documentation |
This function transposes (a specified part of) a matrix or data frame, optionally using one of its columns as column names for the transposed result. It can be useful for turning a species presence-absence table into a regional species composition table.
transpose(data, sp.cols = 1:ncol(data), reg.names = NULL)
data |
a matrix or data frame containing the species occurrence data to transpose. |
sp.cols |
names or index numbers of the columns containing the species occurrences in 'data' which are meant to be transposed. |
reg.names |
name or index number of the column in 'data' containing the region names, to be used as column names in the transposed result. |
This function returns the transposed 'sp.cols' of 'data', with the column specified in 'reg.names' as column names.
A. Marcia Barbosa
t
data(rotif.env)
head(rotif.env)
names(rotif.env)
rotif.reg <- transpose(rotif.env, sp.cols = 18:47, reg.names = 1)
head(rotif.reg)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.