filesstrings (version 0.4.0)

CharListElemsNthElem: Get the nth element of each vector in a list of numeric or character vectors.

Description

These are faster implementations of procedures that could very easily be done with base::sapply.

Usage

CharListElemsNthElem(char_list, n)

NumListElemsNthElem(num_list, n)

Arguments

char_list

A list of character vectors.

n

The index of the element that you want from each vector.

num_list

A list of numeric vectors.

Value

A list.

Examples

Run this code
CharListElemsNthElem(list(c("a", "b", "c"), c("d", "f", "a")), 2)
NumListElemsNthElem(list(1:5, 0:2), 4)

Run the code above in your browser using DataLab