sep_discrete | R Documentation |
This is a function factory that provides a function to split grouped discrete labels into numerical positions.
sep_discrete(sep = ".", inv = FALSE)
sep |
A |
inv |
A |
A function
that accepts character
input and returns
numeric
output.
# 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"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.