From e723b2bd66db15dae534519553bb5f0fd9ff979d Mon Sep 17 00:00:00 2001 From: Sam Date: Fri, 25 Oct 2024 16:23:35 +0100 Subject: [PATCH] add return values for all pcens_df functions in response to CRAN comments --- NEWS.md | 1 + R/pcens.R | 16 +++++++++++++--- cran-comments.md | 4 ++++ man/new_pcens.Rd | 9 ++++++--- man/pcens_cdf.Rd | 5 ++--- man/pcens_cdf.default.Rd | 6 ++++-- man/pcens_cdf.pcens_pgamma_dunif.Rd | 6 ++++-- man/pcens_cdf.pcens_plnorm_dunif.Rd | 6 ++++-- man/pcens_cdf.pcens_pweibull_dunif.Rd | 12 +++--------- 9 files changed, 41 insertions(+), 24 deletions(-) diff --git a/NEWS.md b/NEWS.md index 41dce99..f0f3148 100644 --- a/NEWS.md +++ b/NEWS.md @@ -10,6 +10,7 @@ This is the first major release of `primarycensored` and has been submitted to C - Added `dependencies: "hard"` to the `R-CMD-check` workflow to ensure checks pass without optional dependencies. - Improved handling of examples that use optional dependencies. - Check all URLs for redirects. +- Ensure that all functions have documented return values. # primarycensored 0.6.0 diff --git a/R/pcens.R b/R/pcens.R index c71a596..238af41 100644 --- a/R/pcens.R +++ b/R/pcens.R @@ -2,7 +2,11 @@ #' #' @inheritParams pprimarycensored #' -#' @return An object of class `pcens_{pdist_name}_{dprimary_name}` +#' @return An object of class `pcens_{pdist_name}_{dprimary_name}`. This +#' contains the primary event distribution, the delay distribution, the +#' delay distribution arguments, and any additional arguments. It can be +#' used with the `pcens_cdf()` function to compute the primary event censored +#' cdf. #' #' @family pcens #' @@ -47,7 +51,7 @@ new_pcens <- function( #' useful for testing purposes or for settings where the analytical solution #' breaks down. #' -#' @return Vector of primary event censored CDFs +#' @return Vector of computed primary event censored CDFs #' #' @family pcens #' @@ -77,6 +81,8 @@ pcens_cdf <- function( #' #' @family pcens #' +#' @inherit pcens_cdf return +#' #' @export pcens_cdf.default <- function( object, q, pwindow, use_numeric = FALSE) { @@ -109,6 +115,8 @@ pcens_cdf.default <- function( #' #' @family pcens #' +#' @inherit pcens_cdf return +#' #' @export pcens_cdf.pcens_pgamma_dunif <- function( object, q, pwindow, use_numeric = FALSE) { @@ -182,6 +190,8 @@ pcens_cdf.pcens_pgamma_dunif <- function( #' #' @family pcens #' +#' @inherit pcens_cdf return +#' #' @export pcens_cdf.pcens_plnorm_dunif <- function( object, q, pwindow, use_numeric = FALSE) { @@ -252,7 +262,7 @@ pcens_cdf.pcens_plnorm_dunif <- function( #' #' @inheritParams pcens_cdf #' -#' @family pcens +#' @inherit pcens_cdf return #' #' @export pcens_cdf.pcens_pweibull_dunif <- function( diff --git a/cran-comments.md b/cran-comments.md index 858617d..9e127dd 100644 --- a/cran-comments.md +++ b/cran-comments.md @@ -3,3 +3,7 @@ 0 errors | 0 warnings | 1 note * This is a new release. + +## Comments + +- Ensured that all `pcens_cdf()` functions have documented return values. diff --git a/man/new_pcens.Rd b/man/new_pcens.Rd index 6d83d3c..077bb67 100644 --- a/man/new_pcens.Rd +++ b/man/new_pcens.Rd @@ -44,7 +44,11 @@ passed a pre-assigned variable rather than a function name.} \item{...}{Additional arguments to be passed to pdist} } \value{ -An object of class \verb{pcens_\{pdist_name\}_\{dprimary_name\}} +An object of class \verb{pcens_\{pdist_name\}_\{dprimary_name\}}. This +contains the primary event distribution, the delay distribution, the +delay distribution arguments, and any additional arguments. It can be +used with the \code{pcens_cdf()} function to compute the primary event censored +cdf. } \description{ S3 class for primary event censored distribution computation @@ -54,7 +58,6 @@ Low level primary event censored distribution objects and methods \code{\link{pcens_cdf}()}, \code{\link{pcens_cdf.default}()}, \code{\link{pcens_cdf.pcens_pgamma_dunif}()}, -\code{\link{pcens_cdf.pcens_plnorm_dunif}()}, -\code{\link{pcens_cdf.pcens_pweibull_dunif}()} +\code{\link{pcens_cdf.pcens_plnorm_dunif}()} } \concept{pcens} diff --git a/man/pcens_cdf.Rd b/man/pcens_cdf.Rd index f7f099b..11f32f9 100644 --- a/man/pcens_cdf.Rd +++ b/man/pcens_cdf.Rd @@ -20,7 +20,7 @@ useful for testing purposes or for settings where the analytical solution breaks down.} } \value{ -Vector of primary event censored CDFs +Vector of computed primary event censored CDFs } \description{ Compute primary event censored CDF @@ -30,7 +30,6 @@ Low level primary event censored distribution objects and methods \code{\link{new_pcens}()}, \code{\link{pcens_cdf.default}()}, \code{\link{pcens_cdf.pcens_pgamma_dunif}()}, -\code{\link{pcens_cdf.pcens_plnorm_dunif}()}, -\code{\link{pcens_cdf.pcens_pweibull_dunif}()} +\code{\link{pcens_cdf.pcens_plnorm_dunif}()} } \concept{pcens} diff --git a/man/pcens_cdf.default.Rd b/man/pcens_cdf.default.Rd index 2e61b33..22e15e7 100644 --- a/man/pcens_cdf.default.Rd +++ b/man/pcens_cdf.default.Rd @@ -19,6 +19,9 @@ even for distributions with analytical solutions. This is primarily useful for testing purposes or for settings where the analytical solution breaks down.} } +\value{ +Vector of computed primary event censored CDFs +} \description{ This method serves as a fallback for combinations of delay and primary event distributions that don't have specific implementations. It uses @@ -38,7 +41,6 @@ Low level primary event censored distribution objects and methods \code{\link{new_pcens}()}, \code{\link{pcens_cdf}()}, \code{\link{pcens_cdf.pcens_pgamma_dunif}()}, -\code{\link{pcens_cdf.pcens_plnorm_dunif}()}, -\code{\link{pcens_cdf.pcens_pweibull_dunif}()} +\code{\link{pcens_cdf.pcens_plnorm_dunif}()} } \concept{pcens} diff --git a/man/pcens_cdf.pcens_pgamma_dunif.Rd b/man/pcens_cdf.pcens_pgamma_dunif.Rd index 310950a..b6fa115 100644 --- a/man/pcens_cdf.pcens_pgamma_dunif.Rd +++ b/man/pcens_cdf.pcens_pgamma_dunif.Rd @@ -19,6 +19,9 @@ even for distributions with analytical solutions. This is primarily useful for testing purposes or for settings where the analytical solution breaks down.} } +\value{ +Vector of computed primary event censored CDFs +} \description{ Method for Gamma delay with uniform primary } @@ -27,7 +30,6 @@ Low level primary event censored distribution objects and methods \code{\link{new_pcens}()}, \code{\link{pcens_cdf}()}, \code{\link{pcens_cdf.default}()}, -\code{\link{pcens_cdf.pcens_plnorm_dunif}()}, -\code{\link{pcens_cdf.pcens_pweibull_dunif}()} +\code{\link{pcens_cdf.pcens_plnorm_dunif}()} } \concept{pcens} diff --git a/man/pcens_cdf.pcens_plnorm_dunif.Rd b/man/pcens_cdf.pcens_plnorm_dunif.Rd index 0760379..da92a04 100644 --- a/man/pcens_cdf.pcens_plnorm_dunif.Rd +++ b/man/pcens_cdf.pcens_plnorm_dunif.Rd @@ -19,6 +19,9 @@ even for distributions with analytical solutions. This is primarily useful for testing purposes or for settings where the analytical solution breaks down.} } +\value{ +Vector of computed primary event censored CDFs +} \description{ Method for Log-Normal delay with uniform primary } @@ -27,7 +30,6 @@ Low level primary event censored distribution objects and methods \code{\link{new_pcens}()}, \code{\link{pcens_cdf}()}, \code{\link{pcens_cdf.default}()}, -\code{\link{pcens_cdf.pcens_pgamma_dunif}()}, -\code{\link{pcens_cdf.pcens_pweibull_dunif}()} +\code{\link{pcens_cdf.pcens_pgamma_dunif}()} } \concept{pcens} diff --git a/man/pcens_cdf.pcens_pweibull_dunif.Rd b/man/pcens_cdf.pcens_pweibull_dunif.Rd index f808986..c5c3d92 100644 --- a/man/pcens_cdf.pcens_pweibull_dunif.Rd +++ b/man/pcens_cdf.pcens_pweibull_dunif.Rd @@ -19,15 +19,9 @@ even for distributions with analytical solutions. This is primarily useful for testing purposes or for settings where the analytical solution breaks down.} } +\value{ +Vector of computed primary event censored CDFs +} \description{ Method for Weibull delay with uniform primary } -\seealso{ -Low level primary event censored distribution objects and methods -\code{\link{new_pcens}()}, -\code{\link{pcens_cdf}()}, -\code{\link{pcens_cdf.default}()}, -\code{\link{pcens_cdf.pcens_pgamma_dunif}()}, -\code{\link{pcens_cdf.pcens_plnorm_dunif}()} -} -\concept{pcens}