Learn R Programming

brolgar (version 1.0.0)

near_middle: Return the middle x percent of values

Description

Return the middle x percent of values

Usage

near_middle(x, middle, within)

Value

logical vector

Arguments

x

numeric vector

middle

percentage you want to center around

within

percentage around center

Examples

Run this code
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))
            

Run the code above in your browser using DataLab