Test for all, any or none
if_all(.l, .p = isTRUE, .f)if_any(.l, .p = isTRUE, .f)if_none(.l, .p = isTRUE, .f)
if_any(.l, .p = isTRUE, .f)
if_none(.l, .p = isTRUE, .f)
the list to test.
the predicate for testing. Defaut is isTRUE.
isTRUE
a mapper or a function run if .p(.x) is TRUE.
If .p(.x) is TRUE, .f() is run.
# NOT RUN { if_all(1:10, ~ .x < 11, ~ return(letters[1:10])) if_any(1:10, is.numeric, ~ return(letters[1:10])) if_none(1:10, is.numeric, ~ return(letters[1:10])) # }
Run the code above in your browser using DataLab