test.as.numeric.mondate <- function() {
# mondate arithmetic is not distributive.
checkEquals(as.numeric(mondate.ymd(2014, 12, 31)), 180)
checkEquals(as.numeric(mondate.ymd(2014, 12, 31, timeunits = "years")),
180)
# get timeunits from the mondate
checkEqualsNumeric(as.numeric(mondate.ymd(2014, 12, 31, timeunits = "years"), convert = TRUE),
15)
# get timeunits from as.numeric
checkEqualsNumeric(as.numeric(mondate.ymd(2014, 12, 31), timeunits = "years", convert = TRUE),
15)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.