Creates a list with a specified number of empty slots.

empty_list(size, labels = NULL)

Arguments

size

The number of slots.

labels

An optional character vector (whose length equals size) with labels for the slots.

Value

A list.

Examples

# An empty list with 3 slots
empty_list(3)
#> [[1]]
#> NULL
#> 
#> [[2]]
#> NULL
#> 
#> [[3]]
#> NULL
#> 

# An empty list with labels
empty_list( 3, paste0( "S0", 1:3 ) )
#> $S01
#> NULL
#> 
#> $S02
#> NULL
#> 
#> $S03
#> NULL
#>