Function to extract the day of the week

Description

Function to extract the day from a timestamp of e.g. class POSIXlt, POSIXct, Date, or character. If the option is of type character it should be in the form of yyyy-mm-dd.

Usage

1
2
3
4
5
6
7
wp_wday(timestamp, startmonday = T)

## S3 method for class 'POSIXlt'
wp_wday(timestamp, startmonday = T)

## Default S3 method:
wp_wday(timestamp, startmonday = T)

Arguments

timestamp

Some sort of timestamp e.g. of class POSIXlt, POSIXct, Date, or character. If the option is of type character it should be in the form of yyyy-mm-dd.

startmonday

whether the week should start on Monday (TRUE, the default) or it should start on Sunday (FALSE)

Methods (by class)

  • POSIXlt: method for POSIXlt

  • default: method for everything coercable by as.POSIXlt

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.