list_along: Create a list along given names and default values

View source: R/utils.R

list_alongR Documentation

Create a list along given names and default values

Description

It can be useful to create an list with default values and some settable values. This is similar to the idea of seq_along(), which creates a vector of the same length as its input.

Usage

list_along(names, default = NA, some = NA)

Arguments

names

names of the list to be generated

default

default value for each element of the generated list

some

a list with elements whose names should be included in names, use this to set default values for some elements of the generated list

Value

a list

Examples

list_along(names = c("A", "B", "C"), default = NA, some = list(B = 1))


zzwch/crosslink documentation built on Aug. 27, 2023, 5:57 p.m.