with one click
document
Document package functions. Use when asked to document functions.
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Menu
Document package functions. Use when asked to document functions.
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Based on SOC occupation classification
| name | document |
| description | Document package functions. Use when asked to document functions. |
All functions should be documented in {roxygen2} #' style, including internal/unexported functions.
devtools::document() after changing any roxygen2 docs.Exported functions include a lifecycle badge at the top of their @description:
#' @description
#' `r lifecycle::badge("stable")`
#'
#' One-sentence description.
New functions start with "experimental", changing to "stable" when finalized.
Parameters used in more than one function go in R/aaa-shared.R under @name shared-params; functions inherit them with @inheritParams shared-params. The file alphabetizes parameters, uses @keywords internal, and ends with NULL.
#' @param paramName (`TYPE`) One sentence description. Can include [cross_references()].
#' Additional details on continuation lines if needed.
For TYPE, use: character, length-1 character, length-1 logical, data.frame, list, Date, length-1 integer, environment.
Hungarian-style prefixes indicate parameter type:
b* - Logical (boolean): bUselDatad* - Date: dSnapshotDate, dPrevSnapshotDatedf* - Data frame: dfResults, dfMetrics, dfBoundsdttm* - Datetime/POSIXct: dttmTimestampenv* - Environment: envCallfct* - Factor: fctDispositionint* - Integer: intPageMax, intLineStartl* - List: lAnalysis, lWorkflows, lMetricobj* - Any object: objShapestr* - String or character vector: strName, strStudyID, strMetrics, strIDColumnsv* - Numeric vector: vThresholdUse @returns (not @return):
#' @returns A data frame.
#' @returns A `data.frame` with columns:
#' - `GroupID`: Group identifier.
#' - `MetricID`: Metric identifier.
#' - `SnapshotDate`: Date of the snapshot.
#' @returns The input `dfResults`, invisibly.
#' @returns `NULL` (invisibly).
Use square brackets for function cross-references:
[tibble::tibble()], [glue::glue()][MakeBounds()], [BindResults()]#' @examplesIf interactive() # use for interactive/network-dependent functions
#' MakeBounds(
#' dfResults = reportingResults,
#' dfMetrics = reportingMetrics
#' )
#' @examples # use for self-contained examples
#' library(gsm.core)
#' MakeBounds(
#' dfResults = reportingResults,
#' dfMetrics = reportingMetrics
#' )
@examplesIf interactive() skips examples during R CMD check.
Use @rdname to group related functions (especially S3 methods) under one help page:
#' Printing gsm.reporting objects
#' @name printing
NULL
#' @rdname printing
#' @export
print.gsm_Object <- function(x, ...) { ... }
#' @rdname printing
#' @export
format.gsm_Object <- function(...) { ... }
For S3 methods of functions from other packages:
#' @exportS3Method dplyr::filter
filter.gsm_Results <- function(.data, ...) { ... }
#' Title in sentence case
#'
#' @inheritParams shared-params
#' @returns Use the rules as described above.
#' @keywords internal
No @description, no blank #' lines between sections, no @examples/@examplesIf.