Description Usage Arguments Details Value Author(s) See Also Examples
View source: R/splice_color_order.R
Takes equal-length factors for group membership and ID value (nested within group membership) and returns a new factor ordering more evenly across groups. E.g., for "K" groups, the first level is the first ID in group #1, second level is the first ID in group #2, ..., the K'th level is the first ID in group #K, then the (K+1)st level is the second ID in group #1, and so on. The logic of the algorithm assumes that
1 | splice_color_order(group, ID, as_factor = TRUE)
|
group |
factor denoting group membership. |
ID |
factor denoting identification. Levels must be nested within group (i.e., an ID cannot be listed in 2+ different groups). |
as_factor |
logical return the result as a factor (the default) or, as an alternative, return the whole data frame. |
identical( dat, dat[ order( group, ID ),] )
is TRUE, since this is the use case within which it was developed, and otherwise it's ambiguous what a user would expect. The function will still run if this condition fails, but a warning is issued and results are unpredictable.
a factor
Bill Forrest forrest@gene.com
1 2 3 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.