4 ms·
map() in purrr is functionally equivalent to lapply(). If you can do something in lapply, you can do it with map.
by cwyers 7y ago
map() in purrr is functionally equivalent to lapply(). If you can do something in lapply, you can do it with map.
- notafraudster 7y agoRight, which is why my example used its cousin, apply, instead of lapply. apply over the row margins of a data frame does not have an equivalent in tidyverse.
- hadley 7y agoBeware that apply() coerces data frames to matrices, which is time consuming and forces all columns to have the same type.