split0: Splits into a list

View source: R/split0.R

split0R Documentation

Splits into a list

Description

Splits a vector (which is casted as a factor) by its elements returning a named list with the indices for each unique element of the vector.

Usage

split0(x)

Arguments

x

A vector to split.

Value

A named list according to the unique elements of x with the integer indices of those given elements.

Author(s)

Andrew E Jaffe

See Also

splitit

Examples


split0(letters[seq_len(3)])

## With some repeated info
set.seed(20161005)
abc <- sample(letters[seq_len(3)], 9, replace = TRUE)
split0(abc)

LieberInstitute/jaffelab documentation built on April 1, 2024, 7:26 a.m.