Created
November 22, 2021 19:19
-
-
Save brshallo/f0cdfd38f31947b5edbe3efd8efab036 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| library(tidyverse) | |
| set.seed(1234) | |
| data <- map(1:3, ~runif(10)) %>% | |
| set_names(paste0("x", 1:3)) %>% | |
| as_tibble() %>% | |
| mutate(letters = letters[1:10]) | |
| data | |
| # keep rows where all are above threshold | |
| filter(data, if_all(where(is.double), ~ .x > 0.6)) | |
| # keep rows where any are above threshold | |
| filter(data, if_any(where(is.double), ~ .x > 0.6)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment