strdate converts a text string into a date:
> strdate("now")
[1] "2016-06-05 14:33:54 CDT"
> strdate("3 minutes from now")
[1] "2016-06-05 14:36:54 CDT"
> strdate("1 day from now")
[1] "2016-06-06 14:33:54 CDT"
> strdate("3 minutes ago")
[1] "2016-06-05 14:30:54 CDT"
> strdate("1 day and 3 minutes from now")
[1] "2016-06-06 14:36:54 CDT"
date_range can enumerate days between two dates:
> date_range("5 days ago", "now")
[1] "2016-09-18" "2016-09-19" "2016-09-20" "2016-09-21" "2016-09-22"
[6] "2016-09-23"
Code was taken from Robert Krzyzanowski's testthatsomemore package, with permission.
Strdate is not yet available via CRAN. Instead, it needs to be installed via devtools:
if (!require("devtools")) { install.packages("devtools"); library(devtools) }
install_github("peterhurford/strdate")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.