veg_aggregate {vegtable} | R Documentation |
Aggregating information into a data frame
Description
Compute summarizing tables from vegtable objects.
This function works in a similar way as crosstable()
.
Usage
veg_aggregate(object, data, FUN, ...)
## S4 method for signature 'formula,vegtable,'function''
veg_aggregate(object, data, FUN, use_nas = TRUE, ...)
Arguments
object |
A formula indicating the variables used for the summary.
As in |
data |
Either a data frame or an object of class vegtable. |
FUN |
Function used to aggregate values. |
... |
Further arguments passed to the function |
use_nas |
Logical value indicating whether NA's should be included in categorical variables or not. |
Value
An object of class data.frame.
Author(s)
Miguel Alvarez kamapu78@gmail.com
See Also
Examples
## Transform cover to percentage cover
veg <- cover_trans(x = Kenya_veg, to = "cover")
## Frequency of taxa per publication
atab <- veg_aggregate(object = cover ~ AcceptedName + REFERENCE, data = veg, FUN = length)
head(atab)
## Life form proportions per plot
atab <- veg_aggregate(object = cover ~ lf_behn_2018 + ReleveID, data = veg, FUN = sum)
head(atab)
[Package vegtable version 0.1.8 Index]