Learn R Programming

turner (version 0.1.9)

listify: Create a list from a vector of integers

Description

Given a vector of integers, create a list of indexed vectors.

Usage

listify(indices)

Value

A list of index vectors

Arguments

indices

a vector of integers indicating the length of each vector in the produced list

Author

Gaston Sanchez

See Also

indexify

Examples

Run this code
# let's say you have a vector of indices list like this
number_elements = c(3, 1, 5)

# get list of index vectors based on 'number_elements'
listify(number_elements)

Run the code above in your browser using DataLab