sim_wday: Weekday part of a sim_datetime

Description Usage Arguments Value Examples

Description

sim_wday() returns the weekday of a sim_datetime. It's crucial to use the same origin_date for sim_wday() than the origin_date that was used to generate the sim_datetime. sim_wday() uses the base R format(x, "%u") function.

Usage

1
sim_wday(sim_datetime, origin_date)

Arguments

sim_datetime

A sim_datetime (integer representing the passed seconds since origin_date)

origin_date

A datetime (POSIXt)

Value

A character, giving the weekday number ("1" = Monday, "2" = Tuesday, ..., "7" = Sunday)

Examples

1
2
3
4
origin_date <- as.POSIXct("2016-01-01 00:00:00", tz = "UTC")
sim_wday(60, origin_date)
sim_wday(3600,origin_date)
sim_wday(36*3600,origin_date)

simtimer documentation built on May 2, 2019, 2:26 p.m.