From ac5021716235c7aa29cad4761c429c4539d22ae4 Mon Sep 17 00:00:00 2001 From: Vitalie Spinu Date: Sun, 20 Nov 2016 13:52:16 +0100 Subject: [PATCH] Document and bump version --- DESCRIPTION | 2 +- NEWS.md | 3 +++ R/accessors-day.r | 4 ++-- R/help.r | 2 +- man/lubridate-package.Rd | 2 +- man/year.Rd | 10 ++++++++-- 6 files changed, 16 insertions(+), 7 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 7c399487..75fd2ac5 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -22,7 +22,7 @@ Description: Functions to work with date-times and time-spans: fast and user fun. Enhances: chron, timeDate, zoo, xts, its, tis, timeSeries, fts, tseries -Version: 1.6.0.9000 +Version: 1.6.0.9009 Depends: methods, R (>= 3.0.0) diff --git a/NEWS.md b/NEWS.md index bacf4719..f179576d 100644 --- a/NEWS.md +++ b/NEWS.md @@ -3,6 +3,9 @@ Version 1.6.0.9000 ### NEW FEATURES * [#485](https://github.com/hadley/lubridate/pull/485) `quarter` gained a new argument `fiscal_start` to address the issue of different fiscal conventions. +* [#492](https://github.com/hadley/lubridate/issues/492) New functions `epiweek` and `epiyear`. +* [#257](https://github.com/hadley/lubridate/issues/257) New `start` parameter in `wday` and `wday<-` to set week start. +* [#401](https://github.com/hadley/lubridate/issues/401) New parameter `locale` in `wday`. Labels of the returned factors (when `label=TRUE`) now respect current locale. ### BUG FIXES diff --git a/R/accessors-day.r b/R/accessors-day.r index 9390643f..e9c62a46 100644 --- a/R/accessors-day.r +++ b/R/accessors-day.r @@ -15,10 +15,10 @@ NULL #' will display an abbreviated version of the label, such as "Sun". abbr is #' disregarded if label = FALSE. #' @param value a numeric object -#' @param locale locale to use for day names. Default to current locale. #' @param start day on which week starts following ISO conventions - 1 means #' Monday, 7 means Sunday (default). You can set \code{lubridate.week.start} #' option to control this parameter globally. +#' @param locale locale to use for day names. Default to current locale. #' @return \code{wday} returns the day of the week as a decimal number or an #' ordered factor if label is T. #' @seealso \code{\link{yday}}, \code{\link{mday}} @@ -148,7 +148,7 @@ setMethod("day<-", signature("Period"), function(x, value){ #' @rdname day #' @export -"wday<-" <- function(x, value, start = getOption("lubridate.week.start", 7)){ +"wday<-" <- function(x, start = getOption("lubridate.week.start", 7), value){ if (!is.numeric(value)) { ## FIXME: how to make this localized and preserve backward compatibility? Guesser? labels <- .shift_wday_names(c("sunday", "monday", "tuesday", "wednesday", diff --git a/R/help.r b/R/help.r index 6ca1621d..e2120a83 100644 --- a/R/help.r +++ b/R/help.r @@ -20,7 +20,7 @@ #' \code{\link{Period-class}} objects with the functions #' \code{\link{hm}}, \code{\link{hms}} and \code{\link{ms}}. #' -#' Lubridate has an inbuilt very fast POSIX parser. Most of the \coe{strptime} +#' Lubridate has an inbuilt very fast POSIX parser. Most of the \code{strptime} #' formats and various extensions are supported for English locales. See #' \code{\link{parse_date_time}} for more details. #' diff --git a/man/lubridate-package.Rd b/man/lubridate-package.Rd index 09fc8554..9af3549c 100644 --- a/man/lubridate-package.Rd +++ b/man/lubridate-package.Rd @@ -27,7 +27,7 @@ Lubridate can also parse partial dates from strings into \code{\link{Period-class}} objects with the functions \code{\link{hm}}, \code{\link{hms}} and \code{\link{ms}}. -Lubridate has an inbuilt very fast POSIX parser. Most of the \coe{strptime} +Lubridate has an inbuilt very fast POSIX parser. Most of the \code{strptime} formats and various extensions are supported for English locales. See \code{\link{parse_date_time}} for more details. diff --git a/man/year.Rd b/man/year.Rd index e65c145d..c8f0e698 100644 --- a/man/year.Rd +++ b/man/year.Rd @@ -24,8 +24,10 @@ epiyear(x) the years element of x as a decimal number } \description{ -Date-time must be a POSIXct, POSIXlt, Date, Period, chron, yearmon, yearqtr, zoo, -zooreg, timeDate, xts, its, ti, jul, timeSeries, and fts objects. +Date-time must be a POSIXct, POSIXlt, Date, Period, chron, yearmon, yearqtr, +zoo, zooreg, timeDate, xts, its, ti, jul, timeSeries, and fts +objects. \code{isoyear} and \code{epiyear} return years acording to ISO 8601 +week and epidimilogical week calendars. } \details{ year does not yet support years before 0 C.E. @@ -36,6 +38,10 @@ year(x) year(x) <- 2001 year(x) > 1995 } +\references{ +\url{http://en.wikipedia.org/wiki/ISO_week_date} + \url{http://www.cmmcp.org/epiweek.htm} +} \keyword{chron} \keyword{manip} \keyword{methods}