From ae92cff690ba98fb115fa8203283d96a20e4f4e8 Mon Sep 17 00:00:00 2001 From: walterwilliamson Date: Wed, 9 Oct 2024 09:06:42 -0400 Subject: [PATCH] added parameters to active percent documentation --- NAMESPACE | 4 ++++ R/active_percent.R | 6 ++++++ man/active_percent.Rd | 6 ++++++ 3 files changed, 16 insertions(+) diff --git a/NAMESPACE b/NAMESPACE index b7352875..e6929ad3 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -68,6 +68,10 @@ import(ggplot2) import(patchwork) import(stats) importFrom(DT,renderDataTable) +importFrom(lubridate,"%within%") +importFrom(lubridate,days) importFrom(lubridate,hour) +importFrom(lubridate,interval) importFrom(lubridate,minute) importFrom(magrittr,"%>%") +importFrom(utils,tail) diff --git a/R/active_percent.R b/R/active_percent.R index d12a1bcf..36310f9c 100644 --- a/R/active_percent.R +++ b/R/active_percent.R @@ -9,6 +9,9 @@ #' @inheritParams plot_lasagna #' #' @param tz \strong{tz = "".} A character string specifying the time zone to be used. System-specific (see \code{\link{as.POSIXct}}), but " " is the current time zone, and "GMT" is UTC (Universal Time, Coordinated). Invalid values are most commonly treated as UTC, on some platforms with a warning. +#' @param range_type "manual" or "automatic" depending on the desired time interval to be used +#' @param ndays For "manual" calculation, the length of the time interval in days +#' @param end_date For "manual" calculation, the end date of the desired time interval #' #' @details #'The function `active_percent` produces a tibble object with values equal to the @@ -21,6 +24,9 @@ #' @return A tibble object with five columns: subject id, #' corresponding active_percent value, duration of measurement period in days, start date, and end date. #' +#' @importFrom lubridate days %within% interval +#' @importFrom utils tail +#' #' @export #' #' @author Pratik Patel, Irina Gaynanova diff --git a/man/active_percent.Rd b/man/active_percent.Rd index 8e0a865a..1d12d342 100644 --- a/man/active_percent.Rd +++ b/man/active_percent.Rd @@ -12,6 +12,12 @@ active_percent(data, dt0 = NULL, tz = "") \item{dt0}{The time frequency for interpolated aligned grid in minutes, the default will match the CGM meter's frequency (e.g. 5 min for Dexcom).} \item{tz}{\strong{tz = "".} A character string specifying the time zone to be used. System-specific (see \code{\link{as.POSIXct}}), but " " is the current time zone, and "GMT" is UTC (Universal Time, Coordinated). Invalid values are most commonly treated as UTC, on some platforms with a warning.} + +\item{range_type}{"manual" or "automatic" depending on the desired time interval to be used} + +\item{ndays}{For "manual" calculation, the length of the time interval in days} + +\item{end_date}{For "manual" calculation, the end date of the desired time interval} } \value{ A tibble object with five columns: subject id,