Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

along

Create a list of given length


Description

Questioning lifecycle

It can be useful to create an empty list that you plan to fill later. This is similar to the idea of seq_along(), which creates a vector of the same length as its input.

Usage

list_along(x)

Arguments

x

A vector.

Details

This function might change to vctrs::vec_init().

Value

A list of the same length as x.

Examples

x <- 1:5
seq_along(x)
list_along(x)

purrr

Functional Programming Tools

v0.3.4
GPL-3 | file LICENSE
Authors
Lionel Henry [aut, cre], Hadley Wickham [aut], RStudio [cph, fnd]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.