near_quantile | R Documentation |
Which values are nearest to any given quantiles
near_quantile(x, probs, tol = 0.01)
x |
vector |
probs |
quantiles to calculate |
tol |
tolerance in terms of x that you will accept near to the quantile. Default is 0.01. |
logical vector of TRUE/FALSE if number is close to a quantile
x <- runif(20)
near_quantile(x, 0.5, 0.05)
near_quantile(x, c(0.25, 0.5, 0.75), 0.05)
library(dplyr)
heights %>%
features(height_cm, list(min = min)) %>%
mutate(min_near_median = near_quantile(min, 0.5, 0.01)) %>%
filter(min_near_median)
heights %>%
features(height_cm, list(min = min)) %>%
mutate(min_near_q3 = near_quantile(min, c(0.25, 0.5, 0.75), 0.01)) %>%
filter(min_near_q3)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.