create_jitter_dt: Create Jittered Date Table

Description Usage Arguments Value

View source: R/create_jitter_dt.R

Description

This function creates a lookup dataframe where one column is the original key of an input dataframe and the other is a random number of days (by patient) to jitter the dates

Usage

1
create_jitter_dt(dataset, keycol_name, max_days = 100, seed = 123)

Arguments

dataset

The input data.frame that contains a column which is the key (unique identifier)

keycol_name

A string that is the name of the column that the unique id is located in

max_days

An integer representing the largest number of days that the dates can be jittered

seed

The random seed used to generate the dataset. This can be used to reconstruct the id mapping at a later stage.

Value

A data.frame that contains 2 columns named original.ID and dates to jitter


michaelgao8/dukeehR documentation built on May 4, 2019, 4:23 p.m.