Description Usage Arguments See Also Examples
a common operation is needing to run queries
to update a file-based dataset after N (days, hours, minutes)
have elapsed. iftime
and ifdate
are simple
conditionals that evaluate an expression if and only if
a certain time period has passed since a provided baseline.
1 2 3 |
baseline |
the baseline - the time we're checking the current time against |
offset |
the amount of time that should have elapsed
since |
expr |
an expression to be evaluated if baseline + offset >= current time |
timehandlers
for other time handlers.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | #Use time. If it's been 20 seconds since the
## Not run:
baseline, run.
baseline_time <- Sys.time() - 20
iftime(baseline = baseline_time, offset = 20,
expr = {
print("Baaaah")
})
#[1] "Baaaah"
#Use dates. If it's been 30 days since the
baseline, run.
baseline_date <- Sys.Date() - 30
ifdate(baseline = baseline_time, offset = 30,
expr = {
print("Baaaah")
})
#[1] "Baaaah"
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.