Description Usage Arguments Details Value Author(s) See Also Examples
Form row and column sums or means for the the species matrix based on presence/absence and numeric matrices.
1 2 3 4 5 6 7 8 9 10 11 | ## S4 method for signature 'Vegsoup'
colSums(x, na.rm = FALSE, dims = 1, typeof = "logical", ...)
## S4 method for signature 'Vegsoup'
rowSums(x, na.rm = FALSE, dims = 1, typeof = "logical", ...)
## S4 method for signature 'Vegsoup'
colMeans(x, na.rm = FALSE, dims = 1, typeof = "numeric", ...)
## S4 method for signature 'Vegsoup'
rowMeans(x, na.rm = FALSE, dims = 1, typeof = "numeric", ...)
|
x |
An |
na.rm |
logical. Should missing values (including NaN) be omitted from the calculations? |
dims |
Not used. |
typeof |
The mode of the species matrix to compute values from, defaults to
|
... |
Arguments passed to |
Note, the default behaviour (argument typeof
is missing) operates on a presence/absence version of the species matrix as can be obtained by as.logical(x)
or as.matrix(x, typeof = "logical")
. On this basis colSums
returns the number of occurences of a species in the data set. The rowSums
method returns the number of species with duplicated occurences of species on different layers if there is more than one layer and at least a single species occuring in more than one layer! In this case correct species richness can be obtained with method richness(obj, "sample")
.
The colSums
A numeric vector of suitable size with names taken from the object.
Roland Kaiser
colSums
in package base, as.matrix
in package vegsoup, richness
, layers
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | require(vegsoup)
data(barmstein)
x <- barmstein
# number of species per plot including layer replication
# default method defines typeof = "logical"
rowSums(x)
# true species richness
richness(x, "sample")
# sums of abundances per plot according to coverscale(x)
rowSums(x, typeof = "numeric")
# number of occurences for each species (typeof = "logical")
colSums(x)
# sums of abundances for each species including layer replication
colSums(x, typeof = "numeric")
# mean abundances, also with layer replication!
m1 <- colMeans(x)
# combine all strata
x0 <- layers(x, collapse = "NA") # note, collapse = NA will not work!
m2 <- colMeans(x0, typeof = "numeric")
m1[ grep("amel.oval", names(m1)) ]
m2[ grep("amel.oval", names(m2)) ]
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.