git
GitHub
NULL
[[]]
$
@
slot()
dplyr::case_when
try()
suppressWarnings()
suppressMessages()
purrr
map_*()
map2_*()
walk()
imap()
pmap()
reduce()
map_df*()
pluck()
flatten()
NextMethod()
$print()
lubridate::period()
lobstr::ast():
recurse_call()
expr()
exprs()
enexpr()
enexprs()
ensym()
ensyms()
exec()
do.call
source()
...
base::subset()
browser()
recover()
debug()
callr::r()
dump.frames()
map() has two arguments, a vector and a function. It performs the function on each element of the vector and returns a list. We can also pass in some additional argument into the function.
map()
simple_map <- function(x, f, ...) { out <- vector("list", length(x)) for (i in seq_along(x)) { out[[i]] <- f(x[[i]], ...) } out }