From 3093e00e058ce5599e11089d4a5ad197ce5a6edb Mon Sep 17 00:00:00 2001 From: Olivia Box Power Date: Thu, 6 Feb 2025 12:00:44 +0000 Subject: [PATCH] Make sure all functions have an example and return value --- R/addin.R | 4 ++++ R/aftable.R | 3 +++ man/as_aftable.Rd | 1 + man/at_template_aftable.Rd | 3 +++ man/at_template_workflow.Rd | 3 +++ man/summary.aftable.Rd | 3 +++ 6 files changed, 17 insertions(+) diff --git a/R/addin.R b/R/addin.R index eba8a17..85898f8 100644 --- a/R/addin.R +++ b/R/addin.R @@ -3,6 +3,8 @@ #' Insert at the cursor a template for \code{\link{create_aftable}} from the #' 'aftable' package, pre-filled with demo data. #' +#' @return Empty list. Function is used for side effect. +#' #' @export at_template_aftable <- function() { rstudioapi::insertText(string_create_aftable()) @@ -14,6 +16,8 @@ at_template_aftable <- function() { #' tables, and (b) a call to \code{\link{create_aftable}} pre-filled with #' demo data. #' +#' @return Empty list. Function is used for side effect. +#' #' @export at_template_workflow <- function() { diff --git a/R/aftable.R b/R/aftable.R index fe022ec..f29d040 100644 --- a/R/aftable.R +++ b/R/aftable.R @@ -205,6 +205,7 @@ create_aftable <- function(tab_titles, #' aftable, otherwise \code{FALSE}. #' #' @examples +#' as_aftable(demo_df) #' is_aftable(demo_aftable) #' #' @export @@ -245,6 +246,8 @@ is_aftable <- function(x) { #' @param object An aftable-class object for which to get a summary. #' @param ... Other arguments to pass. #' +#' @return `object` unaltered. +#' #' @examples #' # Print a concise summary of the aftable-class object #' summary(demo_aftable) diff --git a/man/as_aftable.Rd b/man/as_aftable.Rd index 6b2e007..108a2a2 100644 --- a/man/as_aftable.Rd +++ b/man/as_aftable.Rd @@ -21,6 +21,7 @@ aftable, otherwise \code{FALSE}. Functions to check if an object is an aftable, or coerce it if possible. } \examples{ +as_aftable(demo_df) is_aftable(demo_aftable) } diff --git a/man/at_template_aftable.Rd b/man/at_template_aftable.Rd index e444011..54e3895 100644 --- a/man/at_template_aftable.Rd +++ b/man/at_template_aftable.Rd @@ -6,6 +6,9 @@ \usage{ at_template_aftable() } +\value{ +Empty list. Function is used for side effect. +} \description{ Insert at the cursor a template for \code{\link{create_aftable}} from the 'aftable' package, pre-filled with demo data. diff --git a/man/at_template_workflow.Rd b/man/at_template_workflow.Rd index a77835d..0720624 100644 --- a/man/at_template_workflow.Rd +++ b/man/at_template_workflow.Rd @@ -6,6 +6,9 @@ \usage{ at_template_workflow() } +\value{ +Empty list. Function is used for side effect. +} \description{ Insert at the cursor (a) demo templates for cover, contents and notes tables, and (b) a call to \code{\link{create_aftable}} pre-filled with diff --git a/man/summary.aftable.Rd b/man/summary.aftable.Rd index 570816e..66d8ab3 100644 --- a/man/summary.aftable.Rd +++ b/man/summary.aftable.Rd @@ -11,6 +11,9 @@ \item{...}{Other arguments to pass.} } +\value{ +\code{object} unaltered. +} \description{ A concise result summary of an aftable-class object to see information about the sheet content. Shows a numbered list of sheets with each tab title,