Classification

Functions for classifying codes and calculating scores

classify_codes()

Extends the original data with the classification table and keeps data in long format.

classify_charlson()

Extends the original data with the classification table and keeps data in long format. Computes classification table and attaches it to original data. Data stays in long format.

classify_elixhauser()

Extends the original data with the classification table and keeps data in long format. Computes classification table and attaches it to original data. Data stays in long format.

read_classes()

Internal function for providing long classification definitions.

sum_score()

Sum scores for each individual. Allows arbitrary number of scores to be calculated using single function call.

Date functions

Functions for filtering using datetime variables

filter_date_in_ival()

Filtering of datetime data within a time interval. The function finds rows for which date_var is within interval created based on index_date, time_before and time_after.

filter_ival_olap_ival()

Filtering of date interval data within study interval. Can be used for filtering e.g. for hospital visits, which are date intervals (time periods). The function finds rows for which ival_var overlaps with interval created based on index_date, time_before and time_after.

filter_date_first()

Get first value based on datetime variable

filter_date_last()

Get last value based on datetime variable

filter_date_nearest()

Get nearest value based on datetime variable

Helpers and others

Functions that are helpful when conducting data analysis

get_var_types()

Get variable types

get_na_vars()

Function for extracting names of variables which have any NA values

left_join_replace_na()

left_join with fill option

replace_na_by_type()

Replace NA values as default values based no the type of the variable