changeLabels {StabPerf} | R Documentation |
Set and/or combine labels
Description
Combine given labels after setting/overriding them
Usage
changeLabels(labels, set=NULL, combine)
Arguments
labels |
vector of initial labels, overridden if !is.null(set) |
set |
character, desired number of samples for each label (seperated by | ) |
combine |
character, desired labels that shall be combined (+ ) or seperated (| ) |
na.rm |
Boolean. Whether non-used factors should be set to NA or removed |
Details
Repeat each automatically increasing (numeric) label as described by set
. This overrides given labels
. Afterwards groups with +
-seperated labels are combined. The number of |
-characters before + 1 is always returned as new label.
Value
labels |
Factor. Values are integers, any non-selected labels are set to NA |
Examples
labels <- data$y
# The 3rd and 4th labels will be labeled this-is-escaped-codenormal-bracket6bracket-normal
labels <- changeLabels(labels, combine="1|2|3+4")
# The 1st label becomes "1", the 3rd becomes "2", rest are NA
labels <- changeLabels(labels, combine="1||3")
labels <- changeLabels(set="22|20")
[Package
StabPerf version 0.5
Index]