Description Usage Arguments Details Value Examples
reorderFactor
returns dataframe with reordered factor
1 | reorderFactor(df, var, order)
|
df |
dataframe |
var |
variable (factor) to reorder; options are: 'hour' |
order |
list of factor levels in desired order |
This fucntion reorders the levels of factor var. This is useful, for example, for changing the facet order in ggplot2 graphics.
dataframe with reordered factor levels for var
1 2 3 | data(wind)
order <- c(11, 16, 0, 1:10, 12:15, 17:23)
s <- reorderFactor(wind, hour, order)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.