View source: R/plot_shifts_per_doctor.R
plot_shifts_per_doctor | R Documentation |
Plots a bar graph of the total shifts per doctor, stacked by shift type.
plot_shifts_per_doctor(tidy_schedule)
tidy_schedule |
A tibble containing a schedule, as loaded by
|
A ggplot with a stacked bar chart.
load_tidy_schedule()
# Display graph right away.
plot_shifts_per_doctor(example_schedule)
# Plot only a subset of shifts.
example_schedule |>
dplyr::filter(shift_type %in% c('Pjour', 'Bjour')) |>
plot_shifts_per_doctor()
# Same as above but also change axis label and save plot as
# an object for later use.
plot_of_shifts <- example_schedule |>
dplyr::filter(shift_type %in% c('Pjour', 'Bjour')) |>
plot_shifts_per_doctor() +
ggplot2::ylab('Number of Night Shifts')
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.