With map functions you want to think about the input type and the output type. Some functions (e.g.
map()) are more "generic" than others (e.g.
map_int(), etc., which return vectors of their corresponding types).
The difference between the
map_if() family and their
lmap() counterparts is that the latter
operate exclusively on functions that take and return a list (or data frame)
imap() family applies a function to each element of a vector and its index. Taking from the docs below:
imap_xxx(x, ...), an indexed map, is short hand for
map2(x, names(x), ...) if
x has names, or
map2(x, seq_along(x), ...) if it does not. This is useful if you need to compute on both the value and the position of an element.