View source: R/NormalizeGGIRDate.R
| NormalizeGGIRDate | R Documentation |
Convert dates from heterogeneous GGIR output formats into a standard
ISO 8601 date format ("YYYY-MM-DD"). This function performs
format harmonization only and does not apply any time zone conversion.
NormalizeGGIRDate(x)
x |
A vector of dates. Can be of class |
GGIR summary files often contain dates stored as formatted strings,
Excel serial numbers, R Date numbers, or POSIX timestamps.
This function detects the input type and converts all values into
a consistent ISO date representation ("YYYY-MM-DD"), suitable
for merging and aligning GGIR outputs.
Numeric values between 20000 and 60000 are treated as Excel date serials
(origin "1899-12-30"). Other numeric values are treated as R Date
values (origin "1970-01-01").
A character vector of dates formatted as "YYYY-MM-DD".
NormalizeGGIRDate("2019/01/03")
NormalizeGGIRDate("03-01-2019")
NormalizeGGIRDate(43466) # Excel date
NormalizeGGIRDate(Sys.time()) # POSIXct
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.