along {purrr}R Documentation

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

Run examples

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

[Package purrr version 0.3.4 Index]