Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,6 @@
^pkgdown$
^doc$
^Meta$
^\.positai$
^\.claude$
^data-raw$
185 changes: 179 additions & 6 deletions .github/workflows/r-checkrelease.yml
Original file line number Diff line number Diff line change
@@ -1,32 +1,205 @@
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
# CRAN-oriented package checks.
# Based on the current r-lib/actions v2 standard workflow, with additional
# package-specific audits and a strict full-manual release check.

on:
push:
branches: [main, master]
pull_request:
branches: [main, master]
workflow_dispatch:

name: CRAN-ready checks

name: R-CMD-check
permissions: read-all

concurrency:
group: cran-ready-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
R-CMD-check:
package-audit:
name: Package-specific audit
runs-on: ubuntu-latest
timeout-minutes: 45
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
R_KEEP_PKG_SOURCE: yes

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6

- uses: r-lib/actions/setup-r@v2
with:
r-version: release
use-public-rspm: true

- name: Verify apc is not declared as a dependency
run: |
description <- read.dcf("DESCRIPTION")
dependency_fields <- intersect(
c("Depends", "Imports", "Suggests", "Enhances", "LinkingTo"),
colnames(description)
)
entries <- unlist(
strsplit(
paste(description[1L, dependency_fields], collapse = ","),
",",
fixed = TRUE
)
)
packages <- sub("[[:space:]]*\\(.*$", "", trimws(entries))
if ("apc" %in% packages) {
stop("The retired package 'apc' is still declared in DESCRIPTION.")
}
shell: Rscript {0}

- name: Verify no active apc usage remains
shell: bash
run: |
if grep -RInE \
--exclude-dir=.git \
--exclude-dir=docs \
--exclude=test-no-apc-dependency.R \
--exclude=r-checkrelease.yml \
--exclude=r-checkrelease-cran-ready.yml \
'library[[:space:]]*\([[:space:]]*apc[[:space:]]*\)|require[[:space:]]*\([[:space:]]*apc[[:space:]]*\)|requireNamespace[[:space:]]*\([[:space:]]*["'\'' ]*apc["'\'' ]*|import[[:space:]]*\([[:space:]]*apc[[:space:]]*\)|importFrom[[:space:]]*\([[:space:]]*apc[[:space:]]*,|apc::|apc\.(data|fit|forecast)|github::cran/apc' \
DESCRIPTION NAMESPACE R tests vignettes README.md .github; then
echo "Active use of the retired 'apc' package was found."
exit 1
fi

- uses: r-lib/actions/setup-pandoc@v2

- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: |
any::devtools
any::rcmdcheck
any::testthat
any::urlchecker
local::.
needs: check

- name: Regenerate and verify documentation
run: |
devtools::document()
changes <- system2(
"git",
c("status", "--short", "--", "NAMESPACE", "man"),
stdout = TRUE
)
if (length(changes)) {
stop(
"Generated documentation is stale:\n",
paste(changes, collapse = "\n")
)
}
shell: Rscript {0}

- name: Run testthat suite
run: testthat::test_local(stop_on_failure = TRUE)
shell: Rscript {0}

- name: Replication regression smoke test
run: |
data("AutoBI", package = "ChainLadder")
triangle <- ChainLadder::incr2cum(AutoBI$AutoBIPaid)
fit <- clmplus::clmplus(clmplus::AggregateDataPP(triangle), "a")
prediction <- predict(fit)
reference <- ChainLadder::MackChainLadder(triangle)$FullTriangle

stopifnot(
isTRUE(
all.equal(
unname(prediction$full_triangle),
unname(reference),
tolerance = 1e-10
)
)
)
shell: Rscript {0}

- name: Check package URLs
run: urlchecker::url_check(".", parallel = FALSE)
shell: Rscript {0}

platform-checks:
name: ${{ matrix.config.os }} (R ${{ matrix.config.r }})
runs-on: ${{ matrix.config.os }}
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
config:
- {os: macos-latest, r: release}
- {os: windows-latest, r: release}
- {os: ubuntu-latest, r: devel, http-user-agent: release}
- {os: ubuntu-latest, r: oldrel-1}

env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
R_KEEP_PKG_SOURCE: yes

steps:
- uses: actions/checkout@v6

- uses: r-lib/actions/setup-pandoc@v2

- uses: r-lib/actions/setup-r@v2
with:
r-version: ${{ matrix.config.r }}
http-user-agent: ${{ matrix.config.http-user-agent }}

- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::rcmdcheck
needs: check

- uses: r-lib/actions/check-r-package@v2
with:
args: 'c("--no-manual", "--as-cran")'
build_args: 'c("--no-manual", "--compact-vignettes=gs+qpdf")'
error-on: '"warning"'
upload-results: true
upload-snapshots: true

cran-release-check:
name: Ubuntu release, manual and vignettes
runs-on: ubuntu-latest
timeout-minutes: 90
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
R_KEEP_PKG_SOURCE: yes

steps:
- uses: actions/checkout@v6

- uses: r-lib/actions/setup-pandoc@v2

- uses: r-lib/actions/setup-r@v2
with:
r-version: release
use-public-rspm: true

- uses: r-lib/actions/setup-tinytex@v2

- name: Install HTML Tidy
run: |
sudo apt-get update
sudo apt-get install --yes tidy
tidy --version

- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::rcmdcheck
needs: check

- name: Full CRAN-style check
uses: r-lib/actions/check-r-package@v2
with:
args: 'c("--as-cran")'
build_args: 'c("--compact-vignettes=gs+qpdf")'
error-on: '"note"'
upload-results: true
upload-snapshots: true
build_args: 'c("--no-manual","--compact-vignettes=gs+qpdf")'
95 changes: 0 additions & 95 deletions .github/workflows/rhub.yaml

This file was deleted.

3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
.Rproj.user
.Rhistory
.RData
/.RData
.Ruserdata
/doc/
/Meta/
.positai
16 changes: 8 additions & 8 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
Package: clmplus
Type: Package
Depends:
R (>= 3.5.0)
Title: Tool-Box of Chain Ladder Plus Models
Version: 1.0.1
Version: 1.1.0
Authors@R:
c(person(given = "Gabriele",
family = "Pittarello",
role = c("aut", "cre", "cph"),
email = "gabriele.pittarello@uniroma1.it",
email = "gabriele.pittarello@sund.ku.dk",
comment = c(ORCID = "0000-0003-3360-5826")),
person(given = "Munir",
family = "Hiabu",
Expand All @@ -17,7 +19,7 @@ Authors@R:
family = "Villegas",
role = c("aut", "cph"),
email="a.villegas@unsw.edu.au"))
Description: Implementation of the age-period-cohort models for the claim development presented in the manuscript 'Replicating and extending chain-ladder via an age-period-cohort structure on the claim development in a run-off triangle' <doi:10.1080/10920277.2025.249672>.
Description: Implementation of the age-period-cohort models for the claim development presented in the manuscript 'Replicating and extending chain-ladder via an age-period-cohort structure on the claim development in a run-off triangle' <doi:10.1080/10920277.2025.2496725>.
URL: https://github.com/gpitt71/clmplus,
https://gpitt71.github.io/clmplus/
BugReports: https://github.com/gpitt71/clmplus/issues
Expand All @@ -33,11 +35,9 @@ Imports:
Encoding: UTF-8
LazyData: true
Suggests:
testthat (>= 3.0.0),
knitr,
rmarkdown,
apc,
dplyr,
viridis,
tidyr
rmarkdown
VignetteBuilder: knitr, rmarkdown
Config/testthat/edition: 3
RoxygenNote: 7.3.3
Loading
Loading