diff --git a/.github/workflows/R-check-docs.yml b/.github/workflows/R-check-docs.yml new file mode 100644 index 00000000..32e829e5 --- /dev/null +++ b/.github/workflows/R-check-docs.yml @@ -0,0 +1,43 @@ +on: + push: + branches: [main, master] + pull_request: + +name: "Documentation check" + +jobs: + docs-check: + runs-on: ubuntu-latest + env: + GITHUB_PAT: ${{ github.token }} + steps: + - uses: actions/checkout@v4 + + - uses: r-lib/actions/setup-r@v2 + with: + use-public-rspm: true + + - name: Install dependencies + uses: r-lib/actions/setup-r-dependencies@v2 + with: + extra-packages: any::roxygen2 + needs: roxygen2 + + - name: Document + run: roxygen2::roxygenise() + shell: Rscript {0} + + - name: Check for changed files + run: | + git add --all + changes=$(git diff-index HEAD --name-only -- man/ NAMESPACE DESCRIPTION) + if [ -n "$changes" ]; then + echo "Changes found after documenting." + git --no-pager diff + echo "$changes" + echo "Please update documentation." + exit 1 + else + echo "No changes found after documenting." + exit 0 + fi diff --git a/R/est.incidence.by.R b/R/est.incidence.by.R index 4675f259..216021d4 100644 --- a/R/est.incidence.by.R +++ b/R/est.incidence.by.R @@ -5,7 +5,7 @@ #' response model. #' #' @param pop_data [data.frame()] with cross-sectional serology data per antibody and age, and additional columns to identify possible `strata`. -#' @param strata Character vector of stratum-defining variables. Values must be variable names in `pop_data`. +#' @param strata [character()] vector of stratum-defining variables. Values must be variable names in `pop_data`. #' @param curve_strata_varnames A subset of `strata`. Values must be variable names in `curve_params`. Default = "". #' @param noise_strata_varnames A subset of `strata`. Values must be variable names in `noise_params`. Default = "". #' @param num_cores Number of processor cores to use for calculations when computing by strata. If set to more than 1 and package \pkg{parallel} is available, then the computations are executed in parallel. Default = 1L. diff --git a/man/est.incidence.by.Rd b/man/est.incidence.by.Rd index 5b1fc006..89f93d47 100644 --- a/man/est.incidence.by.Rd +++ b/man/est.incidence.by.Rd @@ -43,7 +43,7 @@ est.incidence.by( \item \code{y.high}: upper limit of detection for the current antigen isotype }} -\item{strata}{Character vector of stratum-defining variables. Values must be variable names in \code{pop_data}.} +\item{strata}{\code{\link[=character]{character()}} vector of stratum-defining variables. Values must be variable names in \code{pop_data}.} \item{curve_strata_varnames}{A subset of \code{strata}. Values must be variable names in \code{curve_params}. Default = "".}