Learn R Programming

aweek (version 0.2.2)

as.POSIXlt.aweek: Convert aweek objects to characters or dates

Description

Convert aweek objects to characters or dates

Usage

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

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

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

Arguments

x

an object of class aweek.

tz

passed on to as.POSIXlt()

floor_day

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

...

parameters passed to as.POSIXlt().

See Also

date2week() print.aweek()

Examples

Run this code
# NOT RUN {
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)
# }

Run the code above in your browser using DataLab