Learn R Programming

purrr (version 1.0.2)

along: Create a list of given length

Description

[Deprecated]

This function was deprecated in purrr 1.0.0 since it's not related to the core purpose of purrr.

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)

Value

A list of the same length as x.

Arguments

x

A vector.

Examples

Run this code
x <- 1:5
seq_along(x)
list_along(x)

Run the code above in your browser using DataLab