week: Get/set weeks component of a date-time.

Description Usage Arguments Value References See Also Examples

Description

week returns the number of complete seven day periods that have occured between the date and January 1st, plus one.
isoweek returns the week as it would appear in the ISO 8601 system, which uses a reoccuring leap week.

Usage

1
2
3
4
5
week(x)

week(x) <- value

isoweek(x)

Arguments

x

a date-time object. Must be a POSIXct, POSIXlt, Date, chron, yearmon, yearqtr, zoo, zooreg, timeDate, xts, its, ti, jul, timeSeries, or fts object.

value

a numeric object

Value

the weeks element of x as an integer number

References

http://en.wikipedia.org/wiki/ISO_week_date

See Also

isoyear

Examples

1
2
3
4
5
x <- ymd("2012-03-26")
week(x)
week(x) <- 1
week(x) <- 54
week(x) > 3


Search within the lubridate package
Search all R packages, documentation and source code

Questions? Problems? Suggestions? or email at ian@mutexlabs.com.

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.