cap_at_percentile: Cap numeric values at selected percentiles

Description Usage Arguments Examples

Description

This function capps the lowest and highest values of a numeric vector at specified percentiles. It can be used both with numeric vectors or data frames with mutate or map_at.

Usage

1
cap_at_percentile(x, floor = 0.025, roof = 0.975)

Arguments

x

A vector or data frame

floor

Bottom percentile. Defaults to 0.025

roof

Top percentile. Defaults to 0.975

Examples

1
2
3
4
5
6
x <- seq(1, 100, 1)
cap_at_percentile(x)

data <- data_frame(x = seq(1, 100, 1))
data %>%
  mutate(y = cap_at_percentile(x))

konradsemsch/aider documentation built on May 22, 2019, 2:40 p.m.