From bb0c0126b719b71171a81eef8d94a5787dc7c5d5 Mon Sep 17 00:00:00 2001 From: Daniel Sjoberg Date: Fri, 1 Mar 2024 13:31:44 -0800 Subject: [PATCH] replace `hms::as.hms()` with `hms::as_hms()` --- DESCRIPTION | 2 +- NAMESPACE | 2 +- R/progress.R | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index b211545..0367a5a 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -19,7 +19,7 @@ Depends: R (>= 3.6) Imports: crayon, - hms, + hms (>= 0.5.0), prettyunits, R6 Suggests: diff --git a/NAMESPACE b/NAMESPACE index edcd370..5394b6f 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -4,7 +4,7 @@ export(progress_bar) importFrom(R6,R6Class) importFrom(crayon,col_nchar) importFrom(crayon,col_substr) -importFrom(hms,as.hms) +importFrom(hms,as_hms) importFrom(prettyunits,pretty_bytes) importFrom(prettyunits,vague_dt) importFrom(utils,flush.console) diff --git a/R/progress.R b/R/progress.R index e1687b3..7b92c92 100644 --- a/R/progress.R +++ b/R/progress.R @@ -323,7 +323,7 @@ pb_ratio <- function(self, private) { ratio } -#' @importFrom hms as.hms +#' @importFrom hms as_hms #' @importFrom crayon col_nchar col_substr pb_render <- function(self, private, tokens) { @@ -341,7 +341,7 @@ pb_render <- function(self, private, tokens) { if (private$has_token["elapsedfull"]) { elapsed <- Sys.time() - private$start units(elapsed) <- "secs" - elapsedfull <- format(as.hms(as.integer(elapsed))) + elapsedfull <- format(as_hms(as.integer(elapsed))) str <- sub(str, pattern = ":elapsedfull", replacement = elapsedfull) }