near_middle {brolgar}R Documentation

Return the middle x percent of values

Description

Return the middle x percent of values

Usage

near_middle(x, middle, within)

Arguments

x

numeric vector

middle

percentage you want to center around

within

percentage around center

Value

logical vector

Examples

x <- runif(20)
near_middle(x = x,
            middle = 0.5,
            within = 0.2)
            
library(dplyr)
heights %>% features(height_cm, list(min = min)) %>%
  filter(near_middle(min, 0.5, 0.1))
            

[Package brolgar version 1.0.1 Index]