Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

aweek-conversions

Convert aweek objects to characters or dates


Description

Convert aweek objects to characters or dates

Usage

## S3 method for class 'aweek'
as.Date(x, floor_day = FALSE, ...)

## S3 method for class 'aweek'
as.POSIXlt(x, tz = "", floor_day = FALSE, ...)

## S3 method for class 'aweek'
as.character(x, ...)

Arguments

x

an object of class aweek.

floor_day

when TRUE, the days will be set to the start of the week.

...

parameters passed to as.POSIXlt().

tz

passed on to as.POSIXlt()

See Also

Examples

w <- date2week(Sys.Date(), week_start = "Sunday")
w
# convert to POSIX
as.POSIXlt(w)
as.POSIXlt(w, floor_day = TRUE)
as.POSIXlt(w, floor_day = TRUE, tz = "KST")

# convert to date
as.Date(w)
as.Date(w, floor_day = TRUE)

# convert to character (strip attributes)
as.character(w)

aweek

Convert Dates to Arbitrary Week Definitions

v1.0.2
MIT + file LICENSE
Authors
Zhian N. Kamvar [aut, cre]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.