| clock_mock | R Documentation |
Mock time
clock_mock(on = TRUE)
on |
(logical) turn mocking on with |
timefuzz package required for mocking behavior
## Not run:
if (interactive()) {
# load timefuzz
library(timefuzz)
library(clock)
# turn on mocking
clock_mock()
# do stuff
x <- time_fuzz$new()
## set to today + 435 days
x$freeze(Sys.Date() + 435)
# get time again
now()
# turn off mocking
clock_mock(FALSE)
# get time again
now()
}
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.