From 5a68a5afa1767703e0e6eb5c402cf51cf89d9b3a Mon Sep 17 00:00:00 2001 From: Gerhard Burger Date: Mon, 15 Apr 2024 10:59:37 +0200 Subject: [PATCH] Document utils as internal --- R/input-time.R | 1 + R/utils.R | 6 ++++++ man/dateToTimeList.Rd | 1 + man/dropNulls.Rd | 1 + man/getDefaultTime.Rd | 1 + man/is.wholenumber.Rd | 1 + man/roundTime.Rd | 1 + man/shinyInputLabel.Rd | 1 + man/shinyTimeDebug.Rd | 1 + man/timeListToDate.Rd | 1 + man/timeStringToDate.Rd | 1 + 11 files changed, 16 insertions(+) diff --git a/R/input-time.R b/R/input-time.R index b6d87a5..84f187f 100644 --- a/R/input-time.R +++ b/R/input-time.R @@ -192,6 +192,7 @@ shinyTimeExample <- function() { #' App to test the input with a variety of options #' #' @importFrom shiny runApp +#' @keywords internal shinyTimeDebug <- function() { runApp(system.file('debug', package='shinyTime', mustWork=T), display.mode='normal') } \ No newline at end of file diff --git a/R/utils.R b/R/utils.R index 8d51c4c..0822777 100644 --- a/R/utils.R +++ b/R/utils.R @@ -5,6 +5,7 @@ #' @param inputId The `input` slot #' @param label The label text #' @return A label tag +#' @keywords internal shinyInputLabel <- function (inputId, label = NULL) { tags$label(label, class = "control-label", class = if (is.null(label)) @@ -38,6 +39,7 @@ dateToTimeList <- function(value){ #' Convert a list to a time object #' @param value A list with the hour, minute and second components #' @return A time object +#' @keywords internal timeListToDate <- function(value) { timeStringToDate(paste(c(value$hour, value$min, value$sec), collapse = ':')) } @@ -45,12 +47,14 @@ timeListToDate <- function(value) { #' Convert a string to a time object #' @param string A string with the time in the format "HH:MM:SS" #' @return A time object +#' @keywords internal timeStringToDate <- function(string) { strptime(string, format = "%T") } #' Get the default time #' @return A time object with the value "00:00:00" +#' @keywords internal getDefaultTime <- function(){ timeStringToDate("00:00:00") } @@ -60,6 +64,7 @@ getDefaultTime <- function(){ #' @param x A time object #' @param tol The tolerance for rounding #' @return A time object rounded to the nearest minute +#' @keywords internal is.wholenumber <- function(x, tol = .Machine$double.eps^0.5){ abs(x - round(x)) < tol } @@ -68,6 +73,7 @@ is.wholenumber <- function(x, tol = .Machine$double.eps^0.5){ #' @param time A time object #' @param minutes The number of minutes to round to #' @return A time object rounded to the nearest minute +#' @keywords internal roundTime <- function(time, minutes) { stopifnot(any(class(time) %in% c("POSIXt", "hms"))) stopifnot(is.wholenumber(minutes)) diff --git a/man/dateToTimeList.Rd b/man/dateToTimeList.Rd index 5f1d596..6ac9e27 100644 --- a/man/dateToTimeList.Rd +++ b/man/dateToTimeList.Rd @@ -15,3 +15,4 @@ A list with the hour, minute and second components \description{ Convert a time object to a list } +\keyword{internal} diff --git a/man/dropNulls.Rd b/man/dropNulls.Rd index 0601413..30e6d89 100644 --- a/man/dropNulls.Rd +++ b/man/dropNulls.Rd @@ -15,3 +15,4 @@ A vector or list with all the NULL items removed \description{ Drop NULL values from vector/lists } +\keyword{internal} diff --git a/man/getDefaultTime.Rd b/man/getDefaultTime.Rd index 3d71509..75d8d74 100644 --- a/man/getDefaultTime.Rd +++ b/man/getDefaultTime.Rd @@ -12,3 +12,4 @@ A time object with the value "00:00:00" \description{ Get the default time } +\keyword{internal} diff --git a/man/is.wholenumber.Rd b/man/is.wholenumber.Rd index 877b0e9..e357593 100644 --- a/man/is.wholenumber.Rd +++ b/man/is.wholenumber.Rd @@ -19,3 +19,4 @@ A time object rounded to the nearest minute Round a time object to the nearest minute From ?is.integer } +\keyword{internal} diff --git a/man/roundTime.Rd b/man/roundTime.Rd index c115bf4..a80e39b 100644 --- a/man/roundTime.Rd +++ b/man/roundTime.Rd @@ -17,3 +17,4 @@ A time object rounded to the nearest minute \description{ Round a time object to the nearest minute } +\keyword{internal} diff --git a/man/shinyInputLabel.Rd b/man/shinyInputLabel.Rd index 55337ed..0cb2468 100644 --- a/man/shinyInputLabel.Rd +++ b/man/shinyInputLabel.Rd @@ -17,3 +17,4 @@ A label tag \description{ Create a label tag for a given input } +\keyword{internal} diff --git a/man/shinyTimeDebug.Rd b/man/shinyTimeDebug.Rd index 74973e7..4af8a33 100644 --- a/man/shinyTimeDebug.Rd +++ b/man/shinyTimeDebug.Rd @@ -9,3 +9,4 @@ shinyTimeDebug() \description{ App to test the input with a variety of options } +\keyword{internal} diff --git a/man/timeListToDate.Rd b/man/timeListToDate.Rd index 3d9f752..256aee9 100644 --- a/man/timeListToDate.Rd +++ b/man/timeListToDate.Rd @@ -15,3 +15,4 @@ A time object \description{ Convert a list to a time object } +\keyword{internal} diff --git a/man/timeStringToDate.Rd b/man/timeStringToDate.Rd index cb69690..f1ccfc3 100644 --- a/man/timeStringToDate.Rd +++ b/man/timeStringToDate.Rd @@ -15,3 +15,4 @@ A time object \description{ Convert a string to a time object } +\keyword{internal}