Description Usage Arguments Details Value Author(s) Examples
Recognise date-time variables when month and year are known (otherwise there is no way to differentiate date and month)
1 | recogniseDateTime(dateTime, month, year, time_dummy = "11:11:11")
|
dateTime |
A vector of strings indicating the date and time that satisfy the assumptions specified in the Details section. |
month |
A number (1 to 12) indicating the month this time point is in. |
year |
A number (with 4 digits) indicating the year this time point is in. |
time_dummy |
A dummy time assigned to date-time variables when time is not available. Default is 11:11:11. |
Assumptions made on the format of input time are: (i) only "/" or "-" is used to separate date, month and year, and no mixture of the two symbols in a single time variable; (ii) only ":" is used to separate hour, minute and second, and the order is always in "h:m:s" (second can be missing, but not minute or hour); and (iii) a dateTime variable should contain both date and time.
Returns a string vector of the format
Yilin Ning, Ying Chen
1 2 3 | recogniseDateTime(dateTime = c("02/04/20 1:23", "19/02/20 3:12 PM",
"11/02/2020 12:11:13", "02/04/2020"),
month = 2, year = 2020)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.