View source: R/redcap_import_dates_times.R
redcap_import_dates | R Documentation |
This function prepares date values in a data table for import in REDCap. Dates in Excel can be entered in a variety of formats. This function attempts to account for the most common ways dates may have been entered and converts them into a format compatible with REDCap.
redcap_import_dates(var, unk_day = "01", unk_month = "01", format = "european")
var |
Variable to convert |
unk_day |
Day to use if unknown, i.e. if only the year or only the month + year is found. The default is 01 (2022 -> 2022-01-01). |
unk_month |
Month to use if unknown, i.e. if only the year is found. The default is 01 (2022 -> 2022-01-01). |
format |
Date format to be used: "european" (DMY) or "american" (MDY). Dates that match both formats will be converted accordingly. Default = "european". |
converted variable
var <-c("01.12.2022", "12.2022", "2022", "01/12/2022", "31341")
redcap_import_dates(var)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.