From e077e9b77c223469d2dc3a5dac42b4daa15d2321 Mon Sep 17 00:00:00 2001 From: Daniel Sabanes Bove Date: Fri, 16 Feb 2024 14:01:15 +0100 Subject: [PATCH] 19: Make ready for release (#25) * fill README * add reference to description * switch URL to pkgdown * use sticker * clean NEWS * just line wrap * removing roxytypes and roxylint from Suggests and remove Remotes --- .Rbuildignore | 3 + .pre-commit-config.yaml | 15 ++++- DESCRIPTION | 26 ++++---- NEWS.md | 14 ++-- README.Rmd | 64 +++++++++++++++++++ README.md | 63 +++++++++++++++++- inst/WORDLIST | 21 ++---- man/savvyr-package.Rd | 6 +- .../{savvyr_example.Rmd => introduction.Rmd} | 32 +++++----- 9 files changed, 182 insertions(+), 62 deletions(-) create mode 100644 README.Rmd rename vignettes/{savvyr_example.Rmd => introduction.Rmd} (80%) diff --git a/.Rbuildignore b/.Rbuildignore index c0f0cf0..ccef6ef 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -17,3 +17,6 @@ coverage.* init.sh workflows.md images +^README\.Rmd$ +^data-raw$ +^node_modules$ diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 7de4edb..6aa5f21 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -57,6 +57,10 @@ repos: rev: v4.0.0-alpha.8 hooks: - id: prettier + exclude: > + (?x)^( + README.md + )$ - repo: https://github.com/pre-commit/pre-commit-hooks rev: v4.5.0 hooks: @@ -65,7 +69,11 @@ repos: - id: end-of-file-fixer exclude: '\.Rd' - id: trailing-whitespace - exclude: '\.Rd' + exclude: > + (?x)^( + .*\.Rd| + README.md + )$ - id: check-yaml - id: no-commit-to-branch - id: mixed-line-ending @@ -87,3 +95,8 @@ repos: rev: v0.39.0 hooks: - id: markdownlint + exclude: > + (?x)^( + README.md| + NEWS.md + )$ diff --git a/DESCRIPTION b/DESCRIPTION index 35c7d8a..7acaa79 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -7,24 +7,25 @@ Authors@R: c( person("Thomas", "Kuenzel", email = "thomas.kuenzel@roche.com", role = c("aut", "cre")), person("Kaspar", "Rufibach", email = "kaspar.rufibach@roche.com", role = "aut"), person("Regina", "Stegherr", email = "regina.stegherr@uni-ulm.de", role = "aut"), - person("Daniel", "Sabanes Bove", email = "daniel.sabanes_bove@roche.com", role = "aut"), + person("Daniel", "Sabanés Bové", email = "daniel.sabanes_bove@roche.com", role = "aut"), person("F. Hoffmann-La Roche AG", role = c("cph", "fnd")), person("Universität Ulm", role = c("cph", "fnd")) ) Description: The SAVVY project is a consortium of academic and pharmaceutical industry partners that aims to improve the analyses of adverse event (AE) data in clinical trials through the use of survival techniques appropriately - dealing with varying follow-up times and competing events. - Although statistical methodologies have advanced, in AE analyses often - the incidence proportion, the incidence density or a non-parametric - Kaplan-Meier estimator are used, which either ignore censoring or + dealing with varying follow-up times and competing events, see + Stegherr, Schmoor, Beyersmann, et al. (2021) . + Although statistical methodologies have advanced, + in AE analyses often the incidence proportion, the incidence density or a + non-parametric Kaplan-Meier estimator are used, which either ignore censoring or competing events. This package contains functions to easily conduct the proposed improved AE analyses. License: Apache License 2.0 -URL: https://github.com/openpharma/savvyr/ +URL: https://openpharma.github.io/savvyr/ BugReports: https://github.com/openpharma/savvyr/issues Depends: - R (>= 3.6) + R (>= 4.0) Imports: checkmate, etm, @@ -33,15 +34,10 @@ Suggests: kableExtra, knitr, rmarkdown, - testthat (>= 2.0), - roxytypes, - roxylint -Remotes: - openpharma/roxytypes, - openpharma/roxylint, + testthat (>= 3.0) Config/Needs/documentation: - roxytypes, - roxylint + roxytypes=github::openpharma/roxytypes, + roxylint=github::openpharma/roxylint RdMacros: Rdpack VignetteBuilder: diff --git a/NEWS.md b/NEWS.md index dff5f11..405c792 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,13 +1,9 @@ # savvyr 0.1.0 -### New features +- First CRAN version of the package. +- The package provides functions to easily conduct the improved AE analyses proposed by the SAVVY framework. -* Add an initializer script. +### New Features -### Enhancements - -* Documentation on how to use the initialize a package. - -### Bug fixes - -* None. +- Estimators that do not account for competing events (incidence proportion, incidence density, Inverse Kaplan Meier). +- Estimators accounting for competing events (incidence proportion accounting for competing events and Aalen-Johansen, both first with death only as hard competing event, or using all competing events). diff --git a/README.Rmd b/README.Rmd new file mode 100644 index 0000000..7d4f94a --- /dev/null +++ b/README.Rmd @@ -0,0 +1,64 @@ +--- +output: github_document +--- + + + +```{r, include = FALSE} +knitr::opts_chunk$set( + collapse = TRUE, + comment = "#>", + fig.path = "man/figures/README-", + out.width = "100%" +) +``` + +# savvyr + + +[![Project Status: Active – The project has reached a stable, usable state and is being actively developed.](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active) +[![CRAN status](https://www.r-pkg.org/badges/version-last-release/savvyr)](https://www.r-pkg.org/badges/version-last-release/savvyr) +[![CRAN monthly downloads](https://cranlogs.r-pkg.org/badges/savvyr)](https://cranlogs.r-pkg.org/badges/savvyr) +[![CRAN total downloads](https://cranlogs.r-pkg.org/badges/grand-total/savvyr)](https://cranlogs.r-pkg.org/badges/grand-total/savvyr) +[![Code Coverage](https://raw.githubusercontent.com/openpharma/savvyr/_xml_coverage_reports/data/main/badge.svg)](https://raw.githubusercontent.com/openpharma/savvyr/_xml_coverage_reports/data/main/coverage.xml) + +\ + +The SAVVY project is a consortium of academic and pharmaceutical +industry partners that aims to improve the analyses of adverse event (AE) +data in clinical trials through the use of survival techniques appropriately +dealing with varying follow-up times and competing events. +Although statistical methodologies have advanced, in AE analyses often +the incidence proportion, the incidence density or a non-parametric +Kaplan-Meier estimator are used, which either ignore censoring or +competing events. The `savvyr` package contains functions to easily conduct the +proposed improved AE analyses. + +## Installation + +### Release + +You can install the current release version from *CRAN* with: + +```{r cran-installation, eval = FALSE} +install.packages("savvyr") +``` + +### Development + +You can install the development version of savvyr from [GitHub](https://github.com/) with: + +``` r +if (!require("remotes")) { + install.packages("remotes") +} +remotes::install_github("openpharma/savvyr") +``` + +## Getting Started + +See the [introductory vignette](https://openpharma.github.io/savvyr/main/articles/introduction.html) to get started. + +## Citing `savvyr` + +To cite `savvyr` please see [here](https://openpharma.github.io/savvyr/main/authors.html#citation). diff --git a/README.md b/README.md index a13405d..2fec421 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,62 @@ -# savvyr -Short description of the package + + +# savvyr + + + +[![Project Status: Active – The project has reached a stable, usable +state and is being actively +developed.](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active) +[![CRAN +status](https://www.r-pkg.org/badges/version-last-release/savvyr)](https://www.r-pkg.org/badges/version-last-release/savvyr) +[![CRAN monthly +downloads](https://cranlogs.r-pkg.org/badges/savvyr)](https://cranlogs.r-pkg.org/badges/savvyr) +[![CRAN total +downloads](https://cranlogs.r-pkg.org/badges/grand-total/savvyr)](https://cranlogs.r-pkg.org/badges/grand-total/savvyr) +[![Code +Coverage](https://raw.githubusercontent.com/openpharma/savvyr/_xml_coverage_reports/data/main/badge.svg)](https://raw.githubusercontent.com/openpharma/savvyr/_xml_coverage_reports/data/main/coverage.xml) + + +The SAVVY project is a consortium of academic and pharmaceutical +industry partners that aims to improve the analyses of adverse event +(AE) data in clinical trials through the use of survival techniques +appropriately dealing with varying follow-up times and competing events. +Although statistical methodologies have advanced, in AE analyses often +the incidence proportion, the incidence density or a non-parametric +Kaplan-Meier estimator are used, which either ignore censoring or +competing events. The `savvyr` package contains functions to easily +conduct the proposed improved AE analyses. + +## Installation + +### Release + +You can install the current release version from *CRAN* with: + +``` r +install.packages("savvyr") +``` + +### Development + +You can install the development version of savvyr from +[GitHub](https://github.com/) with: + +``` r +if (!require("remotes")) { + install.packages("remotes") +} +remotes::install_github("openpharma/savvyr") +``` + +## Getting Started + +See the [introductory +vignette](https://openpharma.github.io/savvyr/main/articles/introduction.html) +to get started. + +## Citing `savvyr` + +To cite `savvyr` please see +[here](https://openpharma.github.io/savvyr/main/authors.html#citation). diff --git a/inst/WORDLIST b/inst/WORDLIST index ec2f2a2..b7ec3e8 100644 --- a/inst/WORDLIST +++ b/inst/WORDLIST @@ -3,33 +3,20 @@ AdVerse AE al Beyersmann -BiocCheck -Bove -CMD +Bové +doi et -Forkers funder -github -gitleaks Hoffmann -initializer Johansen Kaplan Kaspar Kuenzel -Lbbert -Pkgdown -Pre -pre -repo -Roxygen Rufibach -Sabanes +Sabanés savvyr Schmoor Stegherr -SuperLinter Ulm -Universit -Universitt +Universität VarYing diff --git a/man/savvyr-package.Rd b/man/savvyr-package.Rd index aa322ca..da5ddb3 100644 --- a/man/savvyr-package.Rd +++ b/man/savvyr-package.Rd @@ -8,12 +8,12 @@ \description{ \if{html}{\figure{logo.png}{options: style='float: right' alt='logo' width='120'}} -The SAVVY project is a consortium of academic and pharmaceutical industry partners that aims to improve the analyses of adverse event (AE) data in clinical trials through the use of survival techniques appropriately dealing with varying follow-up times and competing events. Although statistical methodologies have advanced, in AE analyses often the incidence proportion, the incidence density or a non-parametric Kaplan-Meier estimator are used, which either ignore censoring or competing events. This package contains functions to easily conduct the proposed improved AE analyses. +The SAVVY project is a consortium of academic and pharmaceutical industry partners that aims to improve the analyses of adverse event (AE) data in clinical trials through the use of survival techniques appropriately dealing with varying follow-up times and competing events, see Stegherr, Schmoor, Beyersmann, et al. (2021) \doi{10.1186/s13063-021-05354-x}. Although statistical methodologies have advanced, in AE analyses often the incidence proportion, the incidence density or a non-parametric Kaplan-Meier estimator are used, which either ignore censoring or competing events. This package contains functions to easily conduct the proposed improved AE analyses. } \seealso{ Useful links: \itemize{ - \item \url{https://github.com/openpharma/savvyr/} + \item \url{https://openpharma.github.io/savvyr/} \item Report bugs at \url{https://github.com/openpharma/savvyr/issues} } @@ -25,7 +25,7 @@ Authors: \itemize{ \item Kaspar Rufibach \email{kaspar.rufibach@roche.com} \item Regina Stegherr \email{regina.stegherr@uni-ulm.de} - \item Daniel Sabanes Bove \email{daniel.sabanes_bove@roche.com} + \item Daniel Sabanés Bové \email{daniel.sabanes_bove@roche.com} } Other contributors: diff --git a/vignettes/savvyr_example.Rmd b/vignettes/introduction.Rmd similarity index 80% rename from vignettes/savvyr_example.Rmd rename to vignettes/introduction.Rmd index c8aa6d5..5a1d7b1 100644 --- a/vignettes/savvyr_example.Rmd +++ b/vignettes/introduction.Rmd @@ -1,5 +1,5 @@ --- -title: "Estimation of AE probabilities with savvyr" +title: "Introduction to `savvyr`" package: savvyr bibliography: "../inst/REFERENCES.bib" output: @@ -7,7 +7,7 @@ output: toc: true vignette: | %\VignetteEncoding{UTF-8} - %\VignetteIndexEntry{Estimation of AE probabilities with savvyr} + %\VignetteIndexEntry{Introduction to `savvyr`} %\VignetteEngine{knitr::rmarkdown} editor_options: chunk_output_type: console @@ -22,16 +22,16 @@ library(savvyr) library(kableExtra) ``` - - +In this vignette we give an introduction how to use `savvyr` to estimate adverse event probabilities using the SAVVY framework. # Example using dummy data We generate the dataset $S1$ in @stegherr_meta_analytic_2021 using the parameter -values for Arm A. -First we define sample size and range of censoring times. Then we set the hazard +values for Arm A. +First we define the sample size and a range of censoring times. +Then we set the hazard of the three event types (adverse event, death/hard competing event and soft -competing event). After the dataset has been generated we set $\tau$ as the +competing event). After the dataset has been generated, we set $\tau$ as the maximum event time. ```{r, include=TRUE, echo=TRUE} @@ -40,12 +40,14 @@ n <- 200 min_cens <- 0 max_cens <- 1000 -haz_ae <- 0.00265 -haz_death <- 0.00151 -haz_soft <- 0.00227 - set.seed(2020) -dat1 <- generate_data(n, cens = c(min_cens, max_cens), haz_ae, haz_death, haz_soft) +dat1 <- generate_data( + n, + cens = c(min_cens, max_cens), + haz_ae = 0.00265, + haz_death = 0.00151, + haz_soft = 0.00227 +) tau <- max(dat1[, "time_to_event"]) ``` @@ -56,10 +58,10 @@ The structure of the dataset looks as follows: kable(head(dat1, 10), align = c("crcr")) ``` -For this dataset we then compute all the estimators used in the comparisons -in @stegherr_survival_2021 and @stegherr_estimating_2021. +For this dataset we then compute all the estimators used in the comparisons +in @stegherr_survival_2021 and @stegherr_estimating_2021. We start with the estimators that do not account for competing events (incidence -proportion, incidence density, Inverse Kaplan Meier), then incidence proportion +proportion, incidence density, Inverse Kaplan Meier), then incidence proportion accounting for competing events and Aalen-Johansen (both first with death only as hard competing event, then using all competing events):