filtering data of all columns between their IQRs. Tried using filter_all(df_name,IQR(.)), returns the same dataframe
Asked
Active
Viewed 3,496 times
1 Answers
3
IQR
returns a single value with the distance between the 25th and 75th quantiles. To get all the data that is within this range, it is better to just use the quantile
function directly. Here is how you can do it with dplyr::filter
data <- tibble::tibble(x = rnorm(100))
data %>%
dplyr::filter(x > quantile(x, 0.25),
x < quantile(x, 0.75))

tbradley
- 2,210
- 11
- 20