plot_weekend_work: Plot Weekend Work Distribution

View source: R/plot_weekend_work.R

plot_weekend_workR Documentation

Plot Weekend Work Distribution

Description

Takes a schedule from load_tidy_schedule() and returns a plot of the distribution of weekends worked by doctor, partitioned by split by quartiles of weekends entirely off work.

Usage

plot_weekend_work(
  tidy_schedule,
  shift_types = c("PjourD", "MjourD", "Bjour", "LångF", "Pjour", "Mjour"),
  shift_days = c("Friday", "Saturday", "Sunday"),
  quartile_labels = c("0-25% lediga helger", "25-50% lediga helger",
    "50-75% lediga helger", "75-100% lediga helger")
)

Arguments

tidy_schedule

A schedule loaded by load_tidy_schedule().

shift_types

The shift types in Medinet to count as weekend work. Certain shift types, such as vacation, should not be included in this vector to yield accurate results.

shift_days

The days to count as weekend. Defaults to Friday, Saturday, and Sunday, as weekend on-call shifts would start on Friday in the schedule. This might vary by department and might need to be adjusted.

quartile_labels

Labels for quartiles in the graph. As it defaults to Swedish, this parameter is included to facilitate use in other languages. Axis labels and titles can be changed using standard ggplot2 syntax.

Value

A ggplot.

See Also

load_tidy_schedule()

Examples

plot_weekend_work(example_schedule)

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