From b0579b04e7c1df71b5cecb8955e3b426ae549b57 Mon Sep 17 00:00:00 2001 From: Craig Gower-Page Date: Thu, 29 Feb 2024 08:45:32 +0000 Subject: [PATCH] Added RdPack to manage references (#271) --- DESCRIPTION | 2 ++ NAMESPACE | 1 + R/SurvivalQuantities.R | 4 +++- R/brier_score.R | 5 ++++- R/jmpost-package.R | 1 + design/Intro_to_jmpost.Rmd | 2 +- design/bibliography.bib => inst/REFERENCES.bib | 18 ++++++++++++++++++ inst/references.bib | 17 ----------------- man/brierScore.SurvivalQuantities.Rd | 5 ++++- man/brier_score.Rd | 5 ++++- vignettes/statistical-specification.Rmd | 2 +- 11 files changed, 39 insertions(+), 23 deletions(-) rename design/bibliography.bib => inst/REFERENCES.bib (53%) mode change 100755 => 100644 delete mode 100644 inst/references.bib diff --git a/DESCRIPTION b/DESCRIPTION index 00195bd7..d299358d 100755 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -30,6 +30,7 @@ Depends: R (>= 4.1.0) Imports: assertthat, + Rdpack, checkmate, dplyr, stringr, @@ -96,3 +97,4 @@ Collate: 'simulations_sf.R' 'zzz.R' VignetteBuilder: knitr +RdMacros: Rdpack diff --git a/NAMESPACE b/NAMESPACE index aa11ab67..7ccade27 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -184,6 +184,7 @@ import(checkmate) import(ggplot2) import(methods) import(stringr) +importFrom(Rdpack,reprompt) importFrom(ggplot2,autoplot) importFrom(ggplot2.utils,geom_km) importFrom(glue,as_glue) diff --git a/R/SurvivalQuantities.R b/R/SurvivalQuantities.R index aef86acf..5558575a 100644 --- a/R/SurvivalQuantities.R +++ b/R/SurvivalQuantities.R @@ -363,13 +363,15 @@ setMethod( #' #' @description #' Derives the Brier Scores (using Inverse Probability of Censoring Weighting) -#' for the Survival estimates as detailed in Blanche et. al. (2015). +#' for the Survival estimates as detailed in \insertCite{blanche2015}{jmpost}. #' #' @inheritParams SurvivalQuantities-Shared #' @inheritParams Brier-Score-Shared #' #' @family brierScore #' @family SurvivalQuantities +#' @references +#' \insertAllCited{} #' @export brierScore.SurvivalQuantities <- function( object, diff --git a/R/brier_score.R b/R/brier_score.R index a45b47ba..3e1e13b2 100644 --- a/R/brier_score.R +++ b/R/brier_score.R @@ -123,13 +123,16 @@ reverse_km_cen_first <- function(t, times, events) { #' @inheritParams Brier-Score-Shared #' #' @description -#' Implements the Brier Score as detailed in Blanche et. al. (2015) +#' Implements the Brier Score as detailed in \insertCite{blanche2015}{jmpost} #' #' @details #' - `bs_get_squared_dist()` - implements the squared distance part #' of the formula. #' - `bs_get_weights()` - implements the IPCW weighting #' +#' @references +#' \insertAllCited{} +#' #' @keywords internal brier_score <- function( t, diff --git a/R/jmpost-package.R b/R/jmpost-package.R index f95c5717..d52bd953 100644 --- a/R/jmpost-package.R +++ b/R/jmpost-package.R @@ -10,4 +10,5 @@ #' @importFrom glue as_glue #' @importFrom tibble add_case #' @importFrom stats acf +#' @importFrom Rdpack reprompt NULL diff --git a/design/Intro_to_jmpost.Rmd b/design/Intro_to_jmpost.Rmd index 306c6b20..b2c6a437 100755 --- a/design/Intro_to_jmpost.Rmd +++ b/design/Intro_to_jmpost.Rmd @@ -15,7 +15,7 @@ header-includes: - \usetikzlibrary{shapes.geometric, arrows} output: pdf_document: default -bibliography: bibliography.bib +bibliography: '`r system.file("REFERENCES.bib", package = "jmpost")`' vignette: | %\VignetteIndexEntry{Introduction to `jmpost`} %\VignetteEncoding{UTF-8} diff --git a/design/bibliography.bib b/inst/REFERENCES.bib old mode 100755 new mode 100644 similarity index 53% rename from design/bibliography.bib rename to inst/REFERENCES.bib index 459429b5..78a6bc14 --- a/design/bibliography.bib +++ b/inst/REFERENCES.bib @@ -1,3 +1,21 @@ + + + +@article{blanche2015, +author = {Blanche, Paul and Proust-Lima, Cécile and Loubère, Lucie and Berr, Claudine and Dartigues, Jean-François and Jacqmin-Gadda, Hélène}, +title = {Quantifying and comparing dynamic predictive accuracy of joint models for longitudinal marker and time-to-event in presence of censoring and competing risks}, +journal = {Biometrics}, +volume = {71}, +number = {1}, +pages = {102-113}, +keywords = {Competing risks, Dynamic prediction, Joint model, Longitudinal data, Prediction accuracy}, +doi = {https://doi.org/10.1111/biom.12232}, +url = {https://onlinelibrary.wiley.com/doi/abs/10.1111/biom.12232}, +eprint = {https://onlinelibrary.wiley.com/doi/pdf/10.1111/biom.12232}, +year = {2015} +} + + @article{kerioui2020bayesian, title={Bayesian inference using Hamiltonian Monte-Carlo algorithm for nonlinear joint modelling in the context of cancer immunotherapy}, author={Kerioui, Marion and Mercier, Francois and Bertrand, Julie and Tardivon, Coralie and Bruno, Ren{\'e} and Guedj, J{\'e}r{\'e}mie and Desm{\'e}e, Sol{\`e}ne}, diff --git a/inst/references.bib b/inst/references.bib deleted file mode 100644 index 82d983a9..00000000 --- a/inst/references.bib +++ /dev/null @@ -1,17 +0,0 @@ - - - -@article{blanche2015, -author = {Blanche, Paul and Proust-Lima, Cécile and Loubère, Lucie and Berr, Claudine and Dartigues, Jean-François and Jacqmin-Gadda, Hélène}, -title = {Quantifying and comparing dynamic predictive accuracy of joint models for longitudinal marker and time-to-event in presence of censoring and competing risks}, -journal = {Biometrics}, -volume = {71}, -number = {1}, -pages = {102-113}, -keywords = {Competing risks, Dynamic prediction, Joint model, Longitudinal data, Prediction accuracy}, -doi = {https://doi.org/10.1111/biom.12232}, -url = {https://onlinelibrary.wiley.com/doi/abs/10.1111/biom.12232}, -eprint = {https://onlinelibrary.wiley.com/doi/pdf/10.1111/biom.12232}, -year = {2015} -} - diff --git a/man/brierScore.SurvivalQuantities.Rd b/man/brierScore.SurvivalQuantities.Rd index 4915b9cf..ddeac3d0 100644 --- a/man/brierScore.SurvivalQuantities.Rd +++ b/man/brierScore.SurvivalQuantities.Rd @@ -22,7 +22,10 @@ Setting this as \code{TRUE} mirrors the implementation of the \code{{pec}} packa } \description{ Derives the Brier Scores (using Inverse Probability of Censoring Weighting) -for the Survival estimates as detailed in Blanche et. al. (2015). +for the Survival estimates as detailed in \insertCite{blanche2015}{jmpost}. +} +\references{ +\insertAllCited{} } \seealso{ Other brierScore: diff --git a/man/brier_score.Rd b/man/brier_score.Rd index 4cee33ce..8436785f 100644 --- a/man/brier_score.Rd +++ b/man/brier_score.Rd @@ -42,7 +42,7 @@ package.} Setting this as \code{TRUE} mirrors the implementation of the \code{{pec}} package.} } \description{ -Implements the Brier Score as detailed in Blanche et. al. (2015) +Implements the Brier Score as detailed in \insertCite{blanche2015}{jmpost} } \details{ \itemize{ @@ -51,4 +51,7 @@ of the formula. \item \code{bs_get_weights()} - implements the IPCW weighting } } +\references{ +\insertAllCited{} +} \keyword{internal} diff --git a/vignettes/statistical-specification.Rmd b/vignettes/statistical-specification.Rmd index d5750373..29febae4 100644 --- a/vignettes/statistical-specification.Rmd +++ b/vignettes/statistical-specification.Rmd @@ -1,7 +1,7 @@ --- title: "Statistical Specifications" package: jmpost -bibliography: '`r system.file("references.bib", package = "jmpost")`' +bibliography: '`r system.file("REFERENCES.bib", package = "jmpost")`' csl: '`r system.file("jss.csl", package = "jmpost")`' output: rmarkdown::html_vignette: