select_factor_threshold: Select the observations based on the average of a factor

View source: R/select_factor_treshold.R

select_factor_thresholdR Documentation

Select the observations based on the average of a factor

Description

The negative binomial average of the Count variable is calculated for each level of variable. Only the levels which are equal or larger than threshold times the maximal average (in the original scale) are retained.

Usage

select_factor_threshold(observation, variable, threshold)

Arguments

observation

the data.frame with observations

variable

the name of the factor

threshold

the minimal threshold

Examples

observation <- data.frame(
  Count = c(100, 101, 50, 51, 1, 0, 0, 0),
  LocationID = factor(rep(1:4, each = 2))
)
select_factor_threshold(observation, "LocationID", threshold = 0.05)

inbo/n2kanalysis documentation built on Feb. 17, 2024, 1:32 a.m.