Skip to content

Commit

Permalink
Update round_time() documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
danielvartan committed May 24, 2021
1 parent dd91589 commit 4ca993d
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 2 deletions.
18 changes: 17 additions & 1 deletion R/round_time.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,29 @@
#'
#' @description
#'
#' `r lifecycle::badge("maturing")`
#' `r lifecycle::badge("experimental")`
#'
#' `round_time()` takes a `Duration`, `Period`, `difftime`, `hms`, `POSIXct`, or
#' `POSIXlt` object and round its `numeric` value at the ones place.
#'
#' @details
#'
#' ## Deprecation notice
#'
#' `vctrs` support was added to the [lubridate][lubridate::lubridate-package]
#' package with its 1.7.9 version (see the pull
#' [here](https://github.com/tidyverse/lubridate/pull/871)). This resolves
#' issues when rounding `Duration`, `Period`, `Interval`, and `POSIXt` objects
#' to the ones place with the [round][base::round] function.
#'
#' It looks like the [hms][hms::hms-package] will also add `vctrs` support
#' following its 1.0.0 version (learn more
#' [here](https://github.com/tidyverse/hms/issues/18)). When this occurs,
#' `round_time()` functionality will no longer be needed and the function will
#' be removed from the `mctq` package.
#'
#' ## Round standard
#'
#' `round_time()` uses [base::round()] for rounding. That is to say that
#' `round_time()` uses the same IEC 60559 standard (_"go to the even digit"_)
#' for rounding off a 5. Therefore, `round(0.5)` is equal to 0 and `round(-1.5)`
Expand Down
20 changes: 19 additions & 1 deletion man/round_time.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 4ca993d

Please sign in to comment.