sep_discrete {ggh4x} | R Documentation |
Separator for discrete grouped labels
Description
This is a function factory that provides a function to split grouped discrete labels into numerical positions.
Usage
sep_discrete(sep = ".", inv = FALSE)
Arguments
sep |
A |
inv |
A |
Value
A function
that accepts character
input and returns
numeric
output.
Examples
# Here, 'bar.qux' belongs to the second group, so has +1 value
sep_discrete()(c("foo.bar", "bar.bar", "bar.qux"))
# Now, the values are grouped by the groups before the separator
sep_discrete(inv = TRUE)(c("foo.bar", "bar.bar", "bar.qux"))
[Package ggh4x version 0.2.8 Index]