Iterate over input and return character(s)

Iterate over input and return double(s)

Iterate over input and return logical(s)

Iterate over input and return integer(s)

vap_chr(.data, .f, ...)

vap_dbl(.data, .f, ...)

vap_lgl(.data, .f, ...)

vap_int(.data, .f, ...)

Arguments

.data

Input vector

.f

Function or formula call that assumes element is .data

...

Other values passed to function call.

Value

A character vector

A double vector

A logical vector

A integer vector

Examples

## character vap_chr(letters, ~ paste0(.x, "."))
#> [1] "a." "b." "c." "d." "e." "f." "g." "h." "i." "j." "k." "l." "m." "n." "o." #> [16] "p." "q." "r." "s." "t." "u." "v." "w." "x." "y." "z."
## double vap_dbl(rnorm(4), round, 3)
#> [1] -1.400 0.255 -2.437 -0.006
## logical vap_lgl(letters, ~ .x %in% c("a", "e", "i", "o", "u"))
#> [1] TRUE FALSE FALSE FALSE TRUE FALSE FALSE FALSE TRUE FALSE FALSE FALSE #> [13] FALSE FALSE TRUE FALSE FALSE FALSE FALSE FALSE TRUE FALSE FALSE FALSE #> [25] FALSE FALSE
## integer vap_int(rnorm(5), ~ as.integer(.x))
#> [1] 0 1 -1 0 0