Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

multisplit

Split elements belonging to multiple groups


Description

This is like split, except elements can belong to multiple groups, in which case they are repeated to appear in multiple elements of the return value.

Usage

multisplit(x, f)

Arguments

x

The object to split, like a vector.

f

A list-like object of vectors, the same length as x, where each element indicates the groups to which each element of x belongs.

Value

A list-like object, with an element for each unique value in the unlisted f, containing the elements in x where the corresponding element in f contained that value. Just try it.

Author(s)

Michael Lawrence

Examples

multisplit(1:3, list(letters[1:2], letters[2:3], letters[2:4]))

IRanges

Foundation of integer range manipulation in Bioconductor

v2.24.1
Artistic-2.0
Authors
H. Pagès, P. Aboyoun and M. Lawrence
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.