ts_median_excess_plt: Create a plot showing the excess +/- of the median value

Description Usage Arguments Details Value Author(s) Examples

View source: R/ts_median_excess_plt.R

Description

Plot out the excess +/- of the median value grouped by certain time parameters

Usage

1
2
3
4
5
6
7
8
ts_median_excess_plt(
  .data,
  .date_col,
  .value_col,
  .x_axis,
  .ggplot_group_var,
  .years_back
)

Arguments

.data

The data that is being analyzed, data must be a tibble/data.frame

.date_col

The column of the tibble that holds the date

.value_col

The column that holds the value of interest

.x_axis

What is the be the x-axis, day, week, etc.

.ggplot_group_var

The variable to group the ggplot on

.years_back

How many yeas back do you want to go in order to compute the median value

Details

Value

A ggplot2 plot

Author(s)

Steven P Sanderson II, MPH

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
library(timetk)
library(dplyr)
library(lubridate)

ts_ymwdh_tbl(
  .data = m4_daily
  , .date_col = date
) %>%
ts_median_excess_plt(
  .date_col = date
  , .value_col = value
  , .x_axis = wk
  , .ggplot_group_var = yr
  , .years_back = 5
)

spsanderson/LICHospitalR documentation built on Jan. 6, 2022, 12:32 a.m.