Skip to content

Commit

Permalink
prep for merge to master
Browse files Browse the repository at this point in the history
  • Loading branch information
s-fleck committed Nov 30, 2018
1 parent 8e2c3a5 commit 69fa09c
Show file tree
Hide file tree
Showing 21 changed files with 365 additions and 355 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Type: Package
Package: dint
Title: A Toolkit for Year-Quarter, Year-Month and Year-Isoweek Dates
Version: 2.0.0.9002
Version: 2.0.0.9003
Authors@R: person("Stefan", "Fleck", email = "[email protected]", role = c("aut", "cre"))
Maintainer: Stefan Fleck <[email protected]>
Description:
Expand Down
3 changes: 0 additions & 3 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -175,9 +175,6 @@ export(last_of_ym)
export(last_of_yq)
export(last_of_yw)
export(make_date_xx)
export(scale_date_ym)
export(scale_date_yq)
export(scale_date_yw)
export(scale_x_date_ym)
export(scale_x_date_yq)
export(scale_x_date_yw)
Expand Down
12 changes: 9 additions & 3 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
# dint 2.0.0.9000

* Removed functions that were deprecated with dint 2.0.0
* added *ggplot2* scales for dint data types
* added predicates to check wether dates correspond to the boundaries of
years or quarters (`is_quarter_bounds()`, `is_year_bounds()`,
`is_first_of_quarter()`, etc...)
* export methods for `unique` and `summary` that were introduced in the last
version but mistakenly not exported
* One can now subtract two date_xx of the same subclass from each other
(the result is an integer)
* One can now subtract two `date_xx` of the same subclass from each other
(the result is an `integer`)
* added `as_yearmon()` and `as_yearqtr()` for converting to *zoo* S3 classes
* Removed functions that were deprecated with dint 2.0.0
* lots of small fixes


# dint 2.0.0
Expand Down
10 changes: 5 additions & 5 deletions R/arithmetic.R
Original file line number Diff line number Diff line change
Expand Up @@ -187,9 +187,9 @@ range.date_y <- function(..., na.rm = FALSE) {
#'
#' @return a `date_xx` of the same subclass as `x`
#' @export
#' @rdname round_date_xx
#'
#' @examples
#'
#' round(date_yq(2018, 2))
#' round(date_yq(2018, 3))
#' round(date_ym(2018, 6))
Expand All @@ -204,15 +204,15 @@ round.date_yq <- function(x, digits = NULL){



#' @rdname round
#' @rdname round_date_xx
#' @export
round.date_ym <- function(x, digits = NULL){
q <- get_month(x)
ifelse_simple(q %in% 1:6, floor(x), ceiling(x))
}


#' @rdname round
#' @rdname round_date_xx
#' @export
round.date_yw <- function(x, digits = NULL){
q <- get_isoweek(x)
Expand All @@ -221,7 +221,7 @@ round.date_yw <- function(x, digits = NULL){



#' @rdname round
#' @rdname round_date_xx
#' @export
ceiling.date_xx <- function(x){
do.call(which_date_xx(x), list(get_year(x) + 1L, 1L))
Expand All @@ -230,7 +230,7 @@ ceiling.date_xx <- function(x){



#' @rdname round
#' @rdname round_date_xx
#' @export
floor.date_xx <- function(x){
do.call(which_date_xx(x), list(get_year(x), 1L))
Expand Down
Loading

0 comments on commit 69fa09c

Please sign in to comment.