ts_alos_elos_tbl: Time Series - ALOS/ELOS Excess Tibble

Description Usage Arguments Details Value Author(s) Examples

View source: R/time_series_data_manipulation_tbls.R

Description

This takes data from the ts_alos_elos_query() and makes an internal summary table using timetk::summarise_by_time with the following possible choices: "year", "month", "week", these are checked inside of the function, if something else is chose an error will be thrown and the function will exit. It defaults to "month".

Usage

1
ts_alos_elos_tbl(.data, .by_time = "month", .date_col)

Arguments

.data

The data passed in from ts_alos_elos_query()

.by_time

The choices are "year", "month", "week", defaults to "month"

.date_col

The column containing the date variable of interest

Details

Value

A tibble with the following columns:

  1. date_col

  2. visit_count

  3. sum_days

  4. sum_exp_days

  5. alos

  6. elos

  7. excess_days

  8. avg_excess

Author(s)

Steven P. Sanderson II, MPH

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
## Not run: 
library(healthyR)

data <- ts_alos_elos_query()

data %>%
  ts_alos_elos_tbl(.by_time = "year")

data %>%
  ts_alos_elos_tbl(.by_time = "month") %>%
  ts_plt(.date_col = dsch_date, .value_col = avg_excess)

data %>%
  ts_alos_elos_tbl()

data %>%
  ts_alos_elos_tbl(.by_time = "week") %>%
  save_to_excel(.file_name = "weekly_alos_excess")

## End(Not run)

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