sim_wday {simtimer}R Documentation

Weekday part of a sim_datetime

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

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

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)

[Package simtimer version 4.0.0 Index]