veg_aggregate: Aggregating information into a data frame

veg_aggregateR 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 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.

Value

An object of class data.frame.

Author(s)

Miguel Alvarez kamapu78@gmail.com

See Also

aggregate()

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)


vegtable documentation built on March 31, 2023, 10:33 p.m.