wait_and_window: Wait and window

View source: R/timing.R

wait_and_windowR Documentation

Wait and window

Description

Compare a time from the past (then) to the current time (now, default: Sys.time()) and see if wait seconds (default: 1 week) has passed. additionally, only return TRUE if the current time is between the hours given in window (if window is null, then always return)

Usage

wait_and_window(
  then,
  now = Sys.time(),
  wait = as.numeric(Sys.getenv("PHOTOTWEETR_WAIT", one_week)),
  window = c(8, 22),
  verbose = TRUE
)

Arguments

then

a previous time (POSIXct)

now

the current time (default: Sys.time())

wait

the seconds to wait between then and now (default: PHOTOTWEETR_WAIT environment variable or one week if unset)

window

hours between which to return TRUE

verbose

should the wait/window message why? (default: TRUE)

Value

logical


jonkeane/phototweetr documentation built on Jan. 10, 2023, 1:21 p.m.