Description Usage Arguments Value Examples
View source: R/view_boxplots.R
For 'boxes_dots', useful for presenting multiple variables with a similar scale or unit.
1 2 3 |
box.groups |
Grouping by boxplot |
groups |
Grouping by faceting |
dots |
Whether or not to include the dots on the chart |
ylab |
Y-axis label |
xlab |
X-axis label |
Creates a plot with boxplots and dots.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | ## Not run:
library(dplyr)
library(tidyr)
ds <- data.frame(state.region, state.x77) %>% tbl_df()
ds2 <- ds %>%
mutate(HS.Grad = factor(HS.Grad < 50, label = c('Yes', 'No'))) %>%
gather(Measure, Value, -state.region, -HS.Grad) %>%
group_by(Measure) %>%
mutate(Value = scale(Value))
view_boxplots(ds2, 'Measure', 'Value', dots = FALSE, groups = '~HS.Grad')
view_boxplots(ds2, 'Measure', 'Value', dots = FALSE, groups = '~HS.Grad',
group.label.pos = NULL)
view_boxplots(ds2, 'Measure', 'Value', dots = FALSE, groups = 'HS.Grad~.')
view_boxplots(ds2, 'Measure', 'Value', box.groups = 'HS.Grad')
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.