View source: R/derive_functions.R View source: R/derive_followup_time.R
derive_followup_time | R Documentation |
Calculate followup_time, the number of days from index to follow up in days
Calculate followup_time, the number of days from index to follow up in days
derive_followup_time(
data,
index_date = "index_date",
followup_date = "followup_date",
followup_time_rename = "followup_days"
)
derive_followup_time(
data,
index_date = "index_date",
followup_date = "followup_date",
followup_time_rename = "followup_days"
)
data |
dataframe. A one-row-per-patient dataframe. |
index_date |
character. The name of a column in data indicating index dates. |
followup_date |
character. The name of a column in data indicating follow up dates. |
followup_time_rename |
character. (Optional) Name of the resulting follow up days column. |
The cohort dataframe with new columns followup_days, followup_months, followup_years.
dataframe.
https://pumas.nasa.gov/examples/index.php?id=46
data <- cohort_raw %>%
derive_followup_date(
event_date = "dateofdeath",
censor_date = "lastvisitdate"
)
# Derive follow up time from index to follow up in days, months and years.
data %>%
derive_followup_time(
index_date = "lotstartdate",
followup_date = "followup_date"
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.