Description Usage Arguments Value Examples
orderedFactor()
is a convenience wrapper for
factor()
that orders the levels as they appear in the data if the
levels
argument is not specified. This is valuable for making
plots with ggplot2, where the axis labels are usually arranged in
alphabetical order rather than the order in which they appear.
1 | orderedFactor(x = character(), ...)
|
x |
A vector of data, usually taking a small number of distinct values. |
... |
Other arguments passed on to |
A factor.
1 2 | orderedFactor(3:1)
orderedFactor(9:12, exclude=11)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.