Learn R Programming

vegtable (version 0.1.8)

veg_aggregate: 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 formula,vegtable,`function` veg_aggregate(object, data, FUN, use_nas = TRUE, ...)

Value

An object of class data.frame.

Arguments

object

A formula indicating the variables used for the summary. As in crosstable(), the keywords "TaxonName" and "AcceptedName" can be used to retrieve taxonomic names, where the second will set the accepted name for names considered as synonyms.

data

Either a data frame or an object of class vegtable.

FUN

Function used to aggregate values.

...

Further arguments passed to the function stats::aggregate().

use_nas

Logical value indicating whether NA's should be included in categorical variables or not.

Author

Miguel Alvarez kamapu78@gmail.com

See Also

Examples

Run this code
## 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)

Run the code above in your browser using DataLab