Learn R Programming

pollen (version 0.82.0)

outliers_replacer: A Outliers Replacer Function

Description

This function finds outliers in pollen time-series and replaces them with background values

Usage

outliers_replacer(value, date, threshold = 5, sum_percent = 100)

Arguments

value

pollen concentration values

date

dates

threshold

a number indicating how many times outlying value needs to be larger than the background to be replaced (default is 5)

sum_percent

a sum_percent parameter

Value

a new data.frame object with replaced outliers

References

Kasprzyk, I. and A. Walanus.: 2014. Gamma, Gaussian and Logistic Distribution Models for Airborne Pollen Grains and Fungal Spore Season Dynamics, Aerobiologia 30(4), 369-83.

Examples

Run this code
# NOT RUN {
data(pollen_count)
df <- subset(pollen_count, site=='Shire')
new_df <- outliers_replacer(df$birch, df$date)
identical(df, new_df)

library('purrr')
new_pollen_count <- pollen_count %>% split(., .$site) %>%
       map_df(~outliers_replacer(value=.$hazel, date=.$date, threshold=4))

# }

Run the code above in your browser using DataLab