multisplit | R Documentation |
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.
multisplit(x, f)
x |
The object to split, like a vector. |
f |
A list-like object of vectors, the same length as |
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.
Michael Lawrence
multisplit(1:3, list(letters[1:2], letters[2:3], letters[2:4]))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.