along: Helper to create vectors with matching length.
Description
These functions take the idea of seq_along and
generalise it to creating lists (lst_along) and repeating
values (rep_along). The dots and .attrs are forwarded
to with_attributes() to make it easy to add
attributes. Except for lst_along() and raw_along(),
the empty vectors are filled with typed missing values.
x <- 0:5rep_along(x, 1:2)
rep_along(x, 1)
lst_along(x)
# You can also add attributes with additional arguments:rep_along(x, 1, class = "my_class")
dbl_along(x, class = "my_class")