Learn R Programming

⚠️There's a newer version (0.2.2) of this package.Take me there.

healthyR

The goal of healthyR is to help quickly analyze common data problems in the Administrative and Clincial spaces.

Installation

You can install the released version of healthyR from CRAN with:

install.packages("healthyR")

And the development version from GitHub with:

# install.packages("devtools")
devtools::install_github("spsanderson/healthyR")

Example

This is a basic example of using the ts_median_excess_plt() function`:

library(healthyR)
library(timetk)

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
    )

Here is a simple example of using the ts_ymwdh_tbl() function:

library(healthyR)
library(timetk)

ts_ymwdh_tbl(.data = m4_daily, .date_col = date)
#> # A tibble: 9,743 x 8
#>    id    date       value    yr mn       wk wd       hr
#>    <fct> <date>     <dbl> <dbl> <ord> <dbl> <ord> <int>
#>  1 D10   2014-07-03 2076.  2014 Jul      27 Thu       0
#>  2 D10   2014-07-04 2073.  2014 Jul      27 Fri       0
#>  3 D10   2014-07-05 2049.  2014 Jul      27 Sat       0
#>  4 D10   2014-07-06 2049.  2014 Jul      27 Sun       0
#>  5 D10   2014-07-07 2006.  2014 Jul      28 Mon       0
#>  6 D10   2014-07-08 2018.  2014 Jul      28 Tue       0
#>  7 D10   2014-07-09 2019.  2014 Jul      28 Wed       0
#>  8 D10   2014-07-10 2007.  2014 Jul      28 Thu       0
#>  9 D10   2014-07-11 2010   2014 Jul      28 Fri       0
#> 10 D10   2014-07-12 2002.  2014 Jul      28 Sat       0
#> # ... with 9,733 more rows

Here is a simple example of using the plt_gartner_magic_chart() function:

suppressPackageStartupMessages(library(healthyR))
suppressPackageStartupMessages(library(tibble))
suppressPackageStartupMessages(library(dplyr))

gartner_magic_chart_plt(
  .data = tibble(x = rnorm(100, 0, 1), y = rnorm(100, 0, 1))
  , .x_col = x
  , .y_col = y
  , .y_lab = "los"
  , .x_lab = "RA"
  , .plt_title = "Test Title"
  , .tl_lbl = "Top Left lbl"
  , .tr_lbl = "Top Right lbl"
  , .bl_lbl = "Bottom Left lbl"
  , .br_lbl = "Bottom Right lbl"
)

Copy Link

Version

Install

install.packages('healthyR')

Monthly Downloads

271

Version

0.1.4

License

MIT + file LICENSE

Issues

Pull Requests

Stars

Forks

Maintainer

Steven Sanderson

Last Published

June 13th, 2021

Functions in healthyR (0.1.4)

kmeans_obj

K-Means Functions
gartner_magic_chart_plt

Gartner Magic Chart - Plotting of two continuous variables
px_cc_mapping

Procedure to Condition Code Mapping file
sql_mid

Use SQL MID type function
dx_cc_mapping

Diagnosis to Condition Code Mapping file
ts_ymwdh_tbl

Make a tibble with year, month, week, week day and hour information added
category_counts_tbl

Counts by Category
opt_bin

Get the optimal binwidth for a histogram
ts_census_los_daily_tbl

Time Series - Census and LOS by Day
%>%

Pipe operator
sql_left

Use SQL LEFT type function
ts_median_excess_plt

Create a plot showing the excess of the median value
los_ra_index_summary_tbl

Make LOS and Readmit Index Summary Tibble
named_item_list

Tibble to named list
ts_plt

Time Series Plot
top_n_tbl

Top N tibble
ts_alos_plt

Plot ALOS - Average Length of Stay
kmeans_user_item_tbl

K-Means Functions
los_ra_index_plt

Plot LOS and Readmit Index with Variance
ts_readmit_rate_plt

Plot Readmit Rate
kmeans_tidy_tbl

K-Means tidy Functions
kmeans_scree_plt

K-Means Scree Plot
sql_right

Use SQL RIGHT type functions
tidyeval

Tidy eval helpers
kmeans_scree_data_tbl

K-Means Scree Plot Data Table
kmeans_mapped_tbl

K-Means Mapper
save_to_excel

Save a file to Excel