R: Helper to create vectors with matching length.

along {purrr} | R Documentation

## Helper to create vectors with matching length.

### Description

These functions take the idea of `seq_along` and generalise it to creating lists (`list_along`) and repeating values (`rep_along`).

### Usage

    list_along(x)

    rep_along(x, y)

### Arguments

`x` | A vector.
`y` | Values to repeat.

### Examples

    x <- 1:5
    rep_along(x, 1:2)
    rep_along(x, 1)
    list_along(x)

[Package purrr version 0.2.2 Index]