Description Usage Arguments Details Value Possible date range See Also Examples
The function recognizes dates in formats used by INCA and Rockan.
1 | as.Dates(x)
|
x |
atomic vector |
Regular expressions are used to match any of the following date formats:
Y-m-d
: The ISO 8601 standard such as "2017-02-16" as
used by INCA.
Ymd
: such as "20160216" as used by the Rockan
registers
Any of the above with missing day such as "2017-02-00" or "20170200" as used if the exact date is unknown.
Any of the above with missing month such as "2017-00-00" or "20170000" as sometimes used if the exact date is unknown.
Dates between 1950 and 1980 can have missing century prefix, such as "67-01-01", "670101", "670100", "670000" etc as earlier used for some dates in the Rockan registers.
Dates from the 20th century can also have month and day changed to week number such as "6723" or "196723" as sometimes used for death dates in the cancer register (originating from the population register).
The special INCA variable
SKAPAD_DATUM
is also recognized as data but is originally a date and
time object (POSIXct
All dates are coerced to Y-m-d
(ISO 8601):
a missing day is set to 15
a missing month is set to July
a week number is translated to the "median day" of that week
SKAPAD_DATUM
has its
time stamp dropped
An alternative would be to use random assignments of dates within specified periods. This would have some benefits but does not conform to behavior used elsewhere by INCA.
vector of class "Date"
All potential dates are accepted as such. RCC data should however only contain historic data. Dates from the future does therefore raise warnings. The same is true for dates before 1830. The Swedish cancer register was initiated in 1958. The earliest possible dates found in the register should therefore originate from birth date of really old people diagnosed with cancer during that year.
as.Date
1 2 3 4 5 6 7 8 9 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.