Convert multiple selections into a factor
Source:R/multiSelectionToFactor.R
multiSelectionToFactor.Rd
Convert multiple selection information into a factor, typically for use as a covariate or for coloring.
Value
A factor containing the set(s) to which each observation is assigned.
Multiple sets are encoded as comma-separated strings.
Unselected observations are listed as "unselected"
.
Examples
multiSelectionToFactor(list(active=c("A", "B"),
saved1=c("B", "C"), saved2=c("D", "E", "F")),
all.names=LETTERS[1:10])
#> A B C D E
#> active active,saved1 saved1 saved2 saved2
#> F G H I J
#> saved2 unselected unselected unselected unselected
#> Levels: active active,saved1 saved1 saved2 unselected