view_boxplots: For 'boxes_dots', useful for presenting multiple variables...

Description Usage Arguments Value Examples

View source: R/view_boxplots.R

Description

For 'boxes_dots', useful for presenting multiple variables with a similar scale or unit.

Usage

1
2
3
view_boxplots(data, variables, values, box.groups = NULL, groups = NULL,
  dots = TRUE, dot.colour = "grey50", ylab = "Variables",
  xlab = "Value", group.label.pos = "both")

Arguments

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

Value

Creates a plot with boxplots and dots.

Examples

 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)

lwjohnst86/seer documentation built on May 21, 2019, 9:15 a.m.