plot_shifts_per_doctor: Plot Shifts Per Doctor

View source: R/plot_shifts_per_doctor.R

plot_shifts_per_doctorR Documentation

Plot Shifts Per Doctor

Description

Plots a bar graph of the total shifts per doctor, stacked by shift type.

Usage

plot_shifts_per_doctor(tidy_schedule)

Arguments

tidy_schedule

A tibble containing a schedule, as loaded by load_tidy_schedule().

Value

A ggplot with a stacked bar chart.

See Also

load_tidy_schedule()

Examples

# 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')

JonasEngstrom/medinetparser documentation built on April 20, 2024, 12:41 a.m.