Description Usage Arguments Value
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
1 | jitter_dates(dataset, keycol_name, date_cols, direction = "backward", lookup)
|
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 dataset |
date_cols |
A named vector of strings where the elements are the names of the columns in dataset that are presumed dates. The names of the elements are the lubridate-esque formats of the dates, e.g. "mdy_hms" |
direction |
Should the function jitter dates forward or backward? Defaults to "backward" |
lookup |
lookup is a 2-column dataframe with the first column being the key and the second column being the number of days to jitter. Usually the output from create_jitter_dt |
The original dataframe with all dates jittered
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.