Description Usage Arguments Details Value Author(s) Examples
View source: R/time_series_data_manipulation_tbls.R
This takes data from the ts_readmit_excess_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".
1 | ts_readmit_excess_tbl(.data, .by_time = "month", .date_col)
|
.data |
The data passed in from |
.by_time |
The choices are "year", "month", "week", defaults to "month" |
.date_col |
The column containing the date variable of interest |
Returns a tibble
Expects ts_readmit_excess_query()
as the data argument
Cleans the table names and selects the following columns
dsch_date
dsch (which just equals 1 as a record column)
ra_flag
rr_bench
dsch_date gets mutated using lubridate::ymd(dsch_date)
The output columns are:
date_col
value - the excess readmit rate.
A tibble
Steven P. Sanderson II, MPH
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_monthly_readmit_excess_query()
data %>%
ts_readmit_excess_tbl(.by_time = "year")
data %>%
ts_readmit_excess_tbl(.by_time = "month") %>%
ts_plt(.date_col = dsch_date, .value_col = value)
data %>%
ts_readmit_excess_tbl()
data %>%
ts_readmit_excess_tbl(.by_time = "week") %>%
save_to_excel(.file_name = "weekly_readmit_excess")
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.