r2cron: Build Cron Strings from R Expressions

Description Usage Arguments Details Value Examples

View source: R/cron.R

Description

Provide an R expression to each of the arguments, which are different time periods (minutes, hours, days of the month, months, days of the week), and receive an equivalent cron-expression string in return. See 'arguments' for valid value ranges and 'details' for valid input formats.

Usage

1
2
3
4
5
6
7
8
r2cron(
  minutes = 0L:59L,
  hours = 0L:23L,
  days_month = 1L:31L,
  months = 1L:12L,
  days_week = 1L:7L,
  clip = FALSE
)

Arguments

minutes

Minutes past the hour, integers 0 to 59 inclusive.

hours

Hours on a 24-hour clock, integers 0 to 23 inclusive.

days_month

Day number of the month, integers 1 to 31 inclusive.

months

Month number, integers 1 to 12 inclusive.

days_week

Day of the week, integers 1 to 7 inclusive (where Sunday is the first day of the week).

clip

Logical. Copy output to clipboard? Windows, macOS and X11 only. Requires installation of the clipr package.

Details

The time-period arguments default to every unit within that time period, like 'every minute, of every hour, of every day of the month, etc'. The following input formats are acceptable inputs to all the time period arguments:

Value

A character string (copied to the clipboard at the user's discretion).

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
## Not run: 
r2cron(
  minutes = seq(0, 59, 20),
  hours = 15:17,  # 24-hr clock
  days_month = 1,
  months = c(4, 10, 11),
  days_week = c(1, 7),  # Sunday is '1'
  clip = FALSE
)
## End(Not run)

matt-dray/dialga documentation built on Dec. 21, 2021, 2:54 p.m.