UpdateAt: Regularly update an R object starting at a particular...

View source: R/updating.R

UpdateAtR Documentation

Regularly update an R object starting at a particular Date/Time

Description

Sets date and time after which an R object is woken and updated, then a frequency for periodic updates.

Usage

UpdateAt(
  x,
  us.format = FALSE,
  time.zone = "UTC",
  units = "days",
  frequency = 1,
  options = "snapshot"
)

Arguments

x

Character vector to be parsed into the first update date and time by AsDateTime. Each subsequent update occurs based on the frequency and units after x.

us.format

logical; whether to use the US convention for dates; can be NULL in which case both U.S. formats and international formats will be checked

time.zone

An optional time zone (default "UTC").

units

The time unit for regular updates, which can be seconds, minutes, days, weeks or months.

frequency

How often the regular updates should occur, expressed in units units.

options

Either "wakeup" in which case the object is updated even if its document is closed, or "snapshot" which also updates any embedded snapshots of the document, or "only when open" which only updates when the document is open.

Details

If units = "months" then frequency must be an integer. The update time will roll back to the last day of the previous month if no such day exists after stepping forwards a multiple of frequency months.

References

See Wikipedia for a list of time zones.

See Also

RefreshIfOlderThan, UpdateEvery

Examples

## Update once every month starting on 31-1-2017 at 10:00:00
UpdateAt("31-1-2017 10:00:00", time.zone = "Australia/Sydney", units = "months", frequency = 1,
options = "wakeup")

## Update every 3 days starting on 05-15-2017 at 18:00:00
UpdateAt("05-15-2017 18:00:00", us.format = TRUE, time.zone = "America/New_York",
units = "days", frequency = 3, options = "snapshot")

NumbersInternational/flipTime documentation built on Feb. 26, 2024, 6:44 a.m.