From b95427baa1d65a19808d4c0d2742a8e7eab40d20 Mon Sep 17 00:00:00 2001 From: Jeremy Wildfire Date: Thu, 20 Aug 2026 15:12:48 -0400 Subject: [PATCH 1/4] Remove the Tendril dependency so safetyCharts can return to CRAN safetyCharts and safetyGraphics were both archived from CRAN on 2026-03-25 with the notice "requires archived package 'Tendril'". Tendril was archived the same day and has had no release since 2020. Only safetyCharts imported it; safetyGraphics fell for importing safetyCharts. - Drop Tendril from Imports, and delete inst/config/tendril.yaml so the Tendril Plot no longer appears in the safetyGraphics chart list. - Keep tendril_chart() exported and documented, but make it defunct: it now raises an error naming the reason and pointing at the CRAN archive, so existing callers get an explanation rather than "object not found". - Drop safetyGraphics from Suggests. Nothing in this package used it, and because safetyGraphics imports safetyCharts the declaration was circular: with both packages archived, R CMD check --as-cran fails with "Package suggested but not available: 'safetyGraphics'". Removing it lets safetyCharts be submitted first. - Add ^docs$ to .Rbuildignore; the pkgdown site was being shipped inside the source tarball. - Bump to 0.5.0. CRAN's last version was 0.3.0; 0.4.0 is already a public GitHub release in which tendril_chart() works, so it is not free to reuse. - NEWS.md entry covering the removal and everything unreleased since 0.3.0. Worker: W0084 --- .Rbuildignore | 2 + DESCRIPTION | 6 +- NAMESPACE | 1 - NEWS.md | 29 ++++++++++ R/tendril_chart.R | 118 +++++++++++++-------------------------- inst/config/tendril.yaml | 22 -------- man/tendril_chart.Rd | 43 +++++++++----- 7 files changed, 100 insertions(+), 121 deletions(-) delete mode 100644 inst/config/tendril.yaml diff --git a/.Rbuildignore b/.Rbuildignore index 365a167..a740307 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -8,3 +8,5 @@ cran-comments.md ^LICENSE\.md$ ^CRAN-RELEASE$ ^CRAN-SUBMISSION$ +^docs$ +^cran-comments\.md$ diff --git a/DESCRIPTION b/DESCRIPTION index e85c8e3..8747e5a 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: safetyCharts Title: Charts for Monitoring Clinical Trial Safety -Version: 0.4.0 +Version: 0.5.0 Authors@R: person( given = "Jeremy", @@ -15,7 +15,7 @@ BugReports: https://github.com/SafetyGraphics/safetyCharts/issues License: MIT + file LICENSE Encoding: UTF-8 LazyData: true -RoxygenNote: 7.2.3 +RoxygenNote: 7.3.2 Roxygen: list(markdown = TRUE) Imports: dplyr, @@ -34,7 +34,6 @@ Imports: rlang, shiny, stringr, - Tendril, tibble, tidyr, Tplyr @@ -42,7 +41,6 @@ Suggests: testthat, shinytest, safetyData, - safetyGraphics, yaml Depends: R (>= 4.0) diff --git a/NAMESPACE b/NAMESPACE index c704517..924af0e 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -36,7 +36,6 @@ import(shiny) importFrom(DT,DTOutput) importFrom(DT,renderDT) importFrom(RColorBrewer,brewer.pal) -importFrom(Tendril,Tendril) importFrom(dplyr,left_join) importFrom(dplyr,select) importFrom(forcats,fct_drop) diff --git a/NEWS.md b/NEWS.md index 6c67fb5..c0f0c1f 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,32 @@ +# safetyCharts v0.5.0 (Upcoming) + +This is the first release since v0.3.0 and is the release that returns safetyCharts to CRAN. + +## Removed: the Tendril Plot + +- The `Tendril` package was archived from CRAN on 2026-03-25 ("issues were not corrected despite reminders") and has had no release since 2020. Because safetyCharts imported it, safetyCharts was archived the same day, and safetyGraphics was archived for importing safetyCharts. +- `Tendril` has been dropped from `Imports`. That is the whole reason both packages could not stay on CRAN, and dropping it is what lets them return. +- The Tendril Plot has been removed from the chart list (`inst/config/tendril.yaml` deleted), so it no longer appears in the safetyGraphics Shiny application. +- `tendril_chart()` is still exported and still documented, but it is now defunct: calling it raises an error explaining what happened and how to draw the chart directly with the archived `Tendril` package. Existing code gets an explanation rather than an "object not found" error. +- The last working implementation remains in version control at the `v0.4.0` tag. + +## Packaging changes for the CRAN resubmission + +- `safetyGraphics` has been dropped from `Suggests`. It was never used by any code, test or vignette in this package, and because safetyGraphics imports safetyCharts the declaration was circular: with both packages archived, neither could be checked until one of them stopped requiring the other. +- The pkgdown output directory `docs/` is now listed in `.Rbuildignore`, so it is no longer shipped inside the source tarball. + +## New since the v0.3.0 CRAN release + +These changes were made after v0.3.0 and released on GitHub as v0.4.0 (2024-09-20). They reach CRAN for the first time in this release. + +- New charts and modules: `aeExplorer()`, `paneledOutlierExplorer()`, `init_cmExplorer()`, `init_mhExplorer()`. +- New event-stacking utilities: `stack_events()` and `standardize_events()`, for combining event domains into a single timeline-ready data frame. +- New chart configurations: concomitant medications (`cmExplorer`), medical history (`mhExplorer`) and vitals over time (`safetyVitalsOverTime`). +- New chart metadata data sets: `meta_cm`, `meta_ex`, `meta_mh`, `meta_vitals`. +- The `%>%` pipe is now re-exported. +- `aeExplorer()` renders without a treatment column, and treatment-column handling accepts both `NULL` and `""`. +- Chart configuration YAML cleaned up, `NAMESPACE` warnings fixed, and `htmltools`, `magrittr`, `tibble` and `tidyr` added to `Imports` to declare dependencies that were already in use. + # safetyCharts v0.3 This release adds several new features and bug fixes. New features include: diff --git a/R/tendril_chart.R b/R/tendril_chart.R index 1f5356e..e9706cd 100644 --- a/R/tendril_chart.R +++ b/R/tendril_chart.R @@ -1,90 +1,50 @@ - -#' Tendril plot +#' Tendril plot (defunct) #' -#' Create a plot using the {{Tendril}} package +#' @description +#' `tendril_chart()` is defunct as of safetyCharts 0.5.0 and no longer works. #' -#' @param data list of data frames including dataframes named `aes` (adverse events) and `dm` (demographics) -#' @param settings named list of domain-specific settings with the parameters specified below. +#' It drew a tendril plot using the \pkg{Tendril} package, which was archived +#' from CRAN on 2026-03-25 and has had no release since 2020. Because +#' `safetyCharts` imported \pkg{Tendril}, `safetyCharts` was archived on the same +#' day, and `safetyGraphics` followed for importing `safetyCharts`. #' -#' @details The settings object provides details regarding the columns in the data sets. +#' The dependency has been dropped so that both packages can return to CRAN. The +#' function is kept, and kept exported, so that existing code calling it fails +#' with an explanation instead of an "object not found" error. #' -#' \itemize{ -#' \item{"settings$dm$id_col"}{ID column} -#' \item{"settings$dm$treatment_col"}{Treatment column} -#' \item{"settings$dm$treatment_values--group1"}{Name of treatment 1} -#' \item{"settings$dm$treatment_values--group2"}{Name of treatment 2} -#' \item{"settings$aes$id_col"}{ID column)} -#' \item{"settings$aes$bodsys_col"}{Body System} -#' \item{"settings$aes$stdy_col"}{Study Day} -#' } -#' @return returns a chart object +#' The Tendril Plot has also been removed from the chart list used by the +#' `safetyGraphics` Shiny application, so it no longer appears there. #' -#' @import dplyr -#' @importFrom Tendril Tendril -#' @importFrom rlang sym +#' @param data Ignored. Formerly a list of data frames including data frames +#' named `aes` (adverse events) and `dm` (demographics). +#' @param settings Ignored. Formerly a named list of domain-specific settings. +#' +#' @details +#' The last working implementation is preserved in the package's version control +#' history at . Users who still +#' need the chart can install the archived \pkg{Tendril} package from the CRAN +#' archive at and call +#' `Tendril::Tendril()` directly. +#' +#' @return This function does not return a value. It always raises an error of +#' class `defunctError`. +#' +#' @examples +#' # tendril_chart() is defunct and always raises an error: +#' try(tendril_chart(data = NULL, settings = NULL)) #' #' @export #' tendril_chart <- function(data, settings) { - ######################################### - # Prep data - ######################################### - - # Convert settings to symbols ready for standard evaluation - dm_id_sym <- rlang::sym(settings[["dm"]][["id_col"]]) - dm_treatment_sym <- rlang::sym(settings[["dm"]][["treatment_col"]]) - - ae_id_sym <- rlang::sym(settings[["aes"]][["id_col"]]) - ae_bodsys_sym <- rlang::sym(settings[["aes"]][["bodsys_col"]]) - ae_stdy_sym <- rlang::sym(settings[["aes"]][["stdy_col"]]) - - aes_arm <- dplyr::left_join( - data$aes, - data$dm %>% dplyr::select(!!dm_id_sym, !!dm_treatment_sym), - by = settings[["dm"]][["id_col"]] - ) - - # get treatments - treatments <- c( - settings[["aes"]][["treatment_values--group1"]], - settings[["aes"]][["treatment_values--group2"]] - ) - - # TODO check that the treatments exsits in the data - - if (length(treatments) < 2) { - all_treatments <- unique(aes_arm %>% dplyr::pull(!!dm_treatment_sym)) - treatments <- all_treatments[1:2] - } - - # subject data - subj <- data$dm %>% - dplyr::count(!!dm_id_sym, !!dm_treatment_sym) %>% - dplyr::select(-n) %>% - as.data.frame() - - data.tendril <- Tendril::Tendril( - mydata = aes_arm, - rotations = rep(3, dim(aes_arm)[1]), - AEfreqThreshold = 5, - Tag = "Comment", - Treatments = treatments, - Unique.Subject.Identifier = settings[["aes"]][["id_col"]], - Terms = settings[["aes"]][["bodsys_col"]], - Treat = settings[["dm"]][["treatment_col"]], - StartDay = settings[["aes"]][["stdy_col"]], - SubjList = subj, - SubjList.subject = settings[["dm"]][["id_col"]], - SubjList.treatment = settings[["dm"]][["treatment_col"]], - filter_double_events = TRUE, - suppress_warnings = TRUE - ) - - p <- plot( - data.tendril, - coloring = "OR", - percentile = TRUE + .Defunct( + msg = paste0( + "'tendril_chart()' is defunct as of safetyCharts 0.5.0.\n", + "The 'Tendril' package it depended on was archived from CRAN on ", + "2026-03-25, so 'safetyCharts' dropped the dependency in order to ", + "return to CRAN.\n", + "To draw a tendril plot, install 'Tendril' from the CRAN archive ", + "(https://cran.r-project.org/src/contrib/Archive/Tendril/) and call ", + "Tendril::Tendril() directly." + ) ) - - return(p) } diff --git a/inst/config/tendril.yaml b/inst/config/tendril.yaml deleted file mode 100644 index 1247e7e..0000000 --- a/inst/config/tendril.yaml +++ /dev/null @@ -1,22 +0,0 @@ -env: safetyGraphics -label: Tendril Plot -type: plot -package: safetyCharts -export: true -order: 9999 -domain: - - dm - - aes -dataSpec: - dm: - - id_col - - treatment_col - aes: - - id_col - - stdy_col - - endy_col - - bodsys_col -workflow: - main: tendril_chart -links: - tendril: https://cran.r-project.org/package=Tendril diff --git a/man/tendril_chart.Rd b/man/tendril_chart.Rd index 1bf9e6c..538c816 100644 --- a/man/tendril_chart.Rd +++ b/man/tendril_chart.Rd @@ -2,31 +2,44 @@ % Please edit documentation in R/tendril_chart.R \name{tendril_chart} \alias{tendril_chart} -\title{Tendril plot} +\title{Tendril plot (defunct)} \usage{ tendril_chart(data, settings) } \arguments{ -\item{data}{list of data frames including dataframes named \code{aes} (adverse events) and \code{dm} (demographics)} +\item{data}{Ignored. Formerly a list of data frames including data frames +named \code{aes} (adverse events) and \code{dm} (demographics).} -\item{settings}{named list of domain-specific settings with the parameters specified below.} +\item{settings}{Ignored. Formerly a named list of domain-specific settings.} } \value{ -returns a chart object +This function does not return a value. It always raises an error of +class \code{defunctError}. } \description{ -Create a plot using the {{Tendril}} package +\code{tendril_chart()} is defunct as of safetyCharts 0.5.0 and no longer works. + +It drew a tendril plot using the \pkg{Tendril} package, which was archived +from CRAN on 2026-03-25 and has had no release since 2020. Because +\code{safetyCharts} imported \pkg{Tendril}, \code{safetyCharts} was archived on the same +day, and \code{safetyGraphics} followed for importing \code{safetyCharts}. + +The dependency has been dropped so that both packages can return to CRAN. The +function is kept, and kept exported, so that existing code calling it fails +with an explanation instead of an "object not found" error. + +The Tendril Plot has also been removed from the chart list used by the +\code{safetyGraphics} Shiny application, so it no longer appears there. } \details{ -The settings object provides details regarding the columns in the data sets. - -\itemize{ -\item{"settings$dm$id_col"}{ID column} -\item{"settings$dm$treatment_col"}{Treatment column} -\item{"settings$dm$treatment_values--group1"}{Name of treatment 1} -\item{"settings$dm$treatment_values--group2"}{Name of treatment 2} -\item{"settings$aes$id_col"}{ID column)} -\item{"settings$aes$bodsys_col"}{Body System} -\item{"settings$aes$stdy_col"}{Study Day} +The last working implementation is preserved in the package's version control +history at \url{https://github.com/SafetyGraphics/safetyCharts}. Users who still +need the chart can install the archived \pkg{Tendril} package from the CRAN +archive at \url{https://cran.r-project.org/src/contrib/Archive/Tendril/} and call +\code{Tendril::Tendril()} directly. } +\examples{ +# tendril_chart() is defunct and always raises an error: +try(tendril_chart(data = NULL, settings = NULL)) + } From e479d23a5ca7965ebda9b6e1cdb570e17a3886c0 Mon Sep 17 00:00:00 2001 From: Jeremy Wildfire Date: Thu, 20 Aug 2026 15:27:43 -0400 Subject: [PATCH 2/4] Reduce CRAN review risk on the four widget entry points None of these are check failures on R 4.3.3; they are the two things CRAN reviewers most reliably ask a new submission to fix, and this package reads as a new submission because it was archived. - Add \value sections to aeExplorer(), hepExplorer(), paneledOutlierExplorer() and render_widget(). The CRAN Cookbook asks for one on every exported function; these four had none. - Replace the \dontrun{} wrappers on the three widget examples with @examplesIf requireNamespace("safetyData"). All three examples were verified to run here in under 0.2s each, so \dontrun{} was not warranted; the guard is there because safetyData is a Suggests. - Replace cran-comments.md, which claimed "no ERRORs, WARNINGs or NOTEs" on R 4.1.0 and rhub environments that no longer exist. Worker: W0084 --- R/aeExplorer.R | 7 ++++--- R/hepExplorer.R | 7 ++++--- R/paneledOutlierExplorer.R | 8 +++++--- R/render_widget.R | 3 +++ cran-comments.md | 25 +++++++++++++++++++------ man/aeExplorer.Rd | 9 ++++++--- man/hepExplorer.Rd | 9 ++++++--- man/paneledOutlierExplorer.Rd | 9 +++++++-- man/render_widget.Rd | 4 ++++ 9 files changed, 58 insertions(+), 23 deletions(-) diff --git a/R/aeExplorer.R b/R/aeExplorer.R index 5f5795d..eb561f1 100644 --- a/R/aeExplorer.R +++ b/R/aeExplorer.R @@ -30,8 +30,7 @@ #' For more options see the [full specs](https://github.com/RhoInc/aeexplorer/wiki/Configuration) in #' the JavaScript library. #' -#' @examples -#' \dontrun{ +#' @examplesIf requireNamespace("safetyData", quietly = TRUE) #' # Render widget with defaults. #' aeExplorer() #' @@ -48,13 +47,15 @@ #' ) #' ) #' ) -#' } #' #' @param data `list` Named list of data frames that includes participant-level subject data (`dm`) #' and event-level adverse event data (`aes`). #' @param mapping `list` Named list with current data mappings. See details for default mapping. #' @param ... additional options to be added to mapping. Will overwrite mapping. #' +#' @return An `htmlwidget` object of class `aeExplorer`, ready to print in the +#' RStudio viewer, embed in R Markdown, or render inside a Shiny application. +#' #' @importFrom purrr list_modify #' #' @export diff --git a/R/hepExplorer.R b/R/hepExplorer.R index 4c76736..db70306 100644 --- a/R/hepExplorer.R +++ b/R/hepExplorer.R @@ -35,8 +35,7 @@ #' #' For more options see the [full specs](https://github.com/SafetyGraphics/hep-explorer/wiki/Configuration) in the javascript library. #' -#' @examples -#' \dontrun{ +#' @examplesIf requireNamespace("safetyData", quietly = TRUE) #' # Render widget with defaults #' hepExplorer() #' @@ -64,12 +63,14 @@ #' visit_col = "VISIT", #' visitn_col = "VISITNUM" #' ) -#' } #' #' @param data `data.frame` Data frame containing lab data used to render `hepExplorer`. Default: `safetyData::adam_adlbc` #' @param mapping `list` named list with the current data mappings. See details for default mapping. #' @param ... additional options to be added to mapping. Will overwrite mapping. #' +#' @return An `htmlwidget` object of class `hepExplorer`, ready to print in the +#' RStudio viewer, embed in R Markdown, or render inside a Shiny application. +#' #' @importFrom purrr list_modify #' #' @export diff --git a/R/paneledOutlierExplorer.R b/R/paneledOutlierExplorer.R index 1f2cfd1..a1560a6 100644 --- a/R/paneledOutlierExplorer.R +++ b/R/paneledOutlierExplorer.R @@ -42,8 +42,7 @@ #' #' For more options see the [full specs](https://github.com/rhoinc/paneled-outlier-explorer/wiki/Configuration) in the javascript library. #' -#' @examples -#' \dontrun{ +#' @examplesIf requireNamespace("safetyData", quietly = TRUE) #' # Render widget with defaults #' paneledOutlierExplorer() #' @@ -64,11 +63,14 @@ #' normal_range_quantile_low = 0.2, #' normal_range_quantile_high = 0.8, #' ) -#' } #' @param df data frame containing lab data used to render for paneledOutlierExplorer. Default is safetyData::adam_adlbc. #' @param mapping named list with the current data mappings. See details for default mapping. #' @param ... additional options to be added to mapping. Will overwrite mapping. #' +#' @return An `htmlwidget` object of class `paneledOutlierExplorer`, ready to +#' print in the RStudio viewer, embed in R Markdown, or render inside a Shiny +#' application. +#' #' @importFrom purrr list_modify #' #' @export diff --git a/R/render_widget.R b/R/render_widget.R index dd8edd0..142c23c 100644 --- a/R/render_widget.R +++ b/R/render_widget.R @@ -4,6 +4,9 @@ #' @param data named list of current data sets #' @param mapping named list with the current data mappings #' +#' @return An `htmlwidget` object of class `widgetName`, ready to print in the +#' RStudio viewer, embed in R Markdown, or render inside a Shiny application. +#' #' @importFrom htmlwidgets createWidget sizingPolicy #' @importFrom jsonlite toJSON #' diff --git a/cran-comments.md b/cran-comments.md index cfe28e3..58584e8 100644 --- a/cran-comments.md +++ b/cran-comments.md @@ -1,11 +1,24 @@ +## Resubmission of an archived package + +safetyCharts was archived on CRAN on 2026-03-25 because it required the archived package 'Tendril'. + +This release removes that dependency. 'Tendril' is gone from Imports, the tendril chart configuration has been removed so the chart no longer appears in the 'safetyGraphics' application, and `tendril_chart()` is retained as a documented defunct function so that existing code gets an explanation rather than an "object not found" error. + +Every remaining dependency is available from CRAN. + +The version is 0.5.0. The last version on CRAN was 0.3.0; 0.4.0 was released on GitHub only and is not free to reuse. + +`R CMD check --as-cran` reports "New submission" and "Package was archived on CRAN" in the incoming feasibility check. Both are expected for the resubmission of an archived package, and the reason for the archival is resolved as described above. + ## Test environments -* local OS X install, R 4.1.0 -* Fedora Linux, R-devel, clang, gfortran (rhub.io) -* Ubuntu Linux 16.04 LTS, R-release, GCC (rhub.io) -* Windows Server 2008 R2 SP1, R-devel, 32/64 bit (rhub.io) + +* local macOS 14.6.1 (aarch64), R 4.3.3 ## R CMD check results -There were no ERRORs, WARNINGs or NOTEs. + + ## Downstream dependencies -None + +safetyGraphics imports safetyCharts. It was archived on the same day and for the same reason, and will be resubmitted once this package is accepted. diff --git a/man/aeExplorer.Rd b/man/aeExplorer.Rd index 8af045d..e3347bc 100644 --- a/man/aeExplorer.Rd +++ b/man/aeExplorer.Rd @@ -18,6 +18,10 @@ and event-level adverse event data (\code{aes}).} \item{...}{additional options to be added to mapping. Will overwrite mapping.} } +\value{ +An \code{htmlwidget} object of class \code{aeExplorer}, ready to print in the +RStudio viewer, embed in R Markdown, or render inside a Shiny application. +} \description{ Convience mapping of render_widget for aeExplorer. } @@ -50,7 +54,7 @@ For more options see the \href{https://github.com/RhoInc/aeexplorer/wiki/Configu the JavaScript library. } \examples{ -\dontrun{ +\dontshow{if (requireNamespace("safetyData", quietly = TRUE)) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} # Render widget with defaults. aeExplorer() @@ -67,6 +71,5 @@ aeExplorer( ) ) ) -} - +\dontshow{\}) # examplesIf} } diff --git a/man/hepExplorer.Rd b/man/hepExplorer.Rd index 42e24c3..a73ddfd 100644 --- a/man/hepExplorer.Rd +++ b/man/hepExplorer.Rd @@ -13,6 +13,10 @@ hepExplorer(data = safetyData::adam_adlbc, mapping = NULL, ...) \item{...}{additional options to be added to mapping. Will overwrite mapping.} } +\value{ +An \code{htmlwidget} object of class \code{hepExplorer}, ready to print in the +RStudio viewer, embed in R Markdown, or render inside a Shiny application. +} \description{ Convience mapping of render_widget for hepExplorer. } @@ -51,7 +55,7 @@ Parameters that are not included in the default mapping can be accessed via ...; For more options see the \href{https://github.com/SafetyGraphics/hep-explorer/wiki/Configuration}{full specs} in the javascript library. } \examples{ -\dontrun{ +\dontshow{if (requireNamespace("safetyData", quietly = TRUE)) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} # Render widget with defaults hepExplorer() @@ -79,6 +83,5 @@ hepExplorer( visit_col = "VISIT", visitn_col = "VISITNUM" ) -} - +\dontshow{\}) # examplesIf} } diff --git a/man/paneledOutlierExplorer.Rd b/man/paneledOutlierExplorer.Rd index b5d4b9b..39ec87b 100644 --- a/man/paneledOutlierExplorer.Rd +++ b/man/paneledOutlierExplorer.Rd @@ -13,6 +13,11 @@ paneledOutlierExplorer(df = safetyData::adam_adlbc, mapping = NULL, ...) \item{...}{additional options to be added to mapping. Will overwrite mapping.} } +\value{ +An \code{htmlwidget} object of class \code{paneledOutlierExplorer}, ready to +print in the RStudio viewer, embed in R Markdown, or render inside a Shiny +application. +} \description{ Convience mapping of render_widget for paneledOutlierExplorer. } @@ -58,7 +63,7 @@ Parameters that are not included in the default mapping can be accessed via ...; For more options see the \href{https://github.com/rhoinc/paneled-outlier-explorer/wiki/Configuration}{full specs} in the javascript library. } \examples{ -\dontrun{ +\dontshow{if (requireNamespace("safetyData", quietly = TRUE)) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} # Render widget with defaults paneledOutlierExplorer() @@ -79,5 +84,5 @@ paneledOutlierExplorer( normal_range_quantile_low = 0.2, normal_range_quantile_high = 0.8, ) -} +\dontshow{\}) # examplesIf} } diff --git a/man/render_widget.Rd b/man/render_widget.Rd index 429b555..143afff 100644 --- a/man/render_widget.Rd +++ b/man/render_widget.Rd @@ -13,6 +13,10 @@ render_widget(widgetName, data, mapping) \item{mapping}{named list with the current data mappings} } +\value{ +An \code{htmlwidget} object of class \code{widgetName}, ready to print in the +RStudio viewer, embed in R Markdown, or render inside a Shiny application. +} \description{ Render an htmlwidget using standard safetyGraphics workflow } From c49db5bb6ef4048e373ed22925fdf4d5adc08fa7 Mon Sep 17 00:00:00 2001 From: Jeremy Wildfire Date: Thu, 20 Aug 2026 15:47:27 -0400 Subject: [PATCH 3/4] Correct the NEWS entry and the render_widget return description Found by an adversarial audit of this branch. - NEWS.md did not mention the second commit at all. Added bullets for the four new \value sections and for the three examples that now run rather than sitting inside \dontrun{}. - render_widget()'s \value said "an htmlwidget object of class widgetName", which reads as an unfilled template. The class is the value of the widgetName argument; say that. - Dropped the anchored ^cran-comments\.md$ rule added to .Rbuildignore in the first commit. The pre-existing unanchored cran-comments.md rule already matches the file, so it was a second rule for the same path. Worker: W0084 --- .Rbuildignore | 1 - NEWS.md | 2 ++ R/render_widget.R | 5 +++-- man/render_widget.Rd | 5 +++-- 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/.Rbuildignore b/.Rbuildignore index a740307..1ee2a44 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -9,4 +9,3 @@ cran-comments.md ^CRAN-RELEASE$ ^CRAN-SUBMISSION$ ^docs$ -^cran-comments\.md$ diff --git a/NEWS.md b/NEWS.md index c0f0c1f..a03b020 100644 --- a/NEWS.md +++ b/NEWS.md @@ -14,6 +14,8 @@ This is the first release since v0.3.0 and is the release that returns safetyCha - `safetyGraphics` has been dropped from `Suggests`. It was never used by any code, test or vignette in this package, and because safetyGraphics imports safetyCharts the declaration was circular: with both packages archived, neither could be checked until one of them stopped requiring the other. - The pkgdown output directory `docs/` is now listed in `.Rbuildignore`, so it is no longer shipped inside the source tarball. +- `aeExplorer()`, `hepExplorer()`, `paneledOutlierExplorer()` and `render_widget()` now document their return values. CRAN asks for a return value on every exported function, and these four had none. +- The examples for `aeExplorer()`, `hepExplorer()` and `paneledOutlierExplorer()` now run. They were wrapped in `\dontrun{}`, which was not warranted — each renders in well under a second. They are guarded with `@examplesIf requireNamespace("safetyData")` instead, because `safetyData` is a Suggests. ## New since the v0.3.0 CRAN release diff --git a/R/render_widget.R b/R/render_widget.R index 142c23c..d41dd90 100644 --- a/R/render_widget.R +++ b/R/render_widget.R @@ -4,8 +4,9 @@ #' @param data named list of current data sets #' @param mapping named list with the current data mappings #' -#' @return An `htmlwidget` object of class `widgetName`, ready to print in the -#' RStudio viewer, embed in R Markdown, or render inside a Shiny application. +#' @return An `htmlwidget` object whose class is the value of `widgetName`, +#' ready to print in the RStudio viewer, embed in R Markdown, or render +#' inside a Shiny application. #' #' @importFrom htmlwidgets createWidget sizingPolicy #' @importFrom jsonlite toJSON diff --git a/man/render_widget.Rd b/man/render_widget.Rd index 143afff..328e56c 100644 --- a/man/render_widget.Rd +++ b/man/render_widget.Rd @@ -14,8 +14,9 @@ render_widget(widgetName, data, mapping) \item{mapping}{named list with the current data mappings} } \value{ -An \code{htmlwidget} object of class \code{widgetName}, ready to print in the -RStudio viewer, embed in R Markdown, or render inside a Shiny application. +An \code{htmlwidget} object whose class is the value of \code{widgetName}, +ready to print in the RStudio viewer, embed in R Markdown, or render +inside a Shiny application. } \description{ Render an htmlwidget using standard safetyGraphics workflow From f26c14e099a158899d763301bbb04ef66d552f2b Mon Sep 17 00:00:00 2001 From: Jeremy Wildfire Date: Thu, 20 Aug 2026 15:56:30 -0400 Subject: [PATCH 4/4] Keep the widget examples off CRAN's example-timing threshold Unwrapping the \dontrun{} blocks in the previous commit put two examples on the clock for the first time. R CMD check measured hepExplorer at 3.69s and paneledOutlierExplorer at 4.12s elapsed on an M-series Mac, against CRAN's 5s per-example threshold and on hardware faster than CRAN's builders. Each block renders four widgets over all 254 subjects of safetyData::adam_adlbc, and the cost is serialising 74,264 rows to JSON once per printed widget. Both examples now slice the data to 20 subjects first, which cuts the print cost roughly tenfold while still demonstrating exactly what they demonstrated before. The full-data default is named in a comment so the example does not misrepresent what the function does with no arguments. Also, unrelated to timing but same review surface: - Quote 'Shiny' in the Description, per the CRAN Cookbook. safetyGraphics already quotes it in the same sentence pattern. - Add ^inst/sandbox$ to .Rbuildignore. Those two files are development scratch, not package code -- one has a roxygen example that downloads a CSV and calls a function this package does not export. They shipped in 0.3.0; they should not ship again. Nothing is deleted, only excluded from the build. Worker: W0084 --- .Rbuildignore | 1 + DESCRIPTION | 2 +- R/hepExplorer.R | 16 ++++++++++++---- R/paneledOutlierExplorer.R | 12 ++++++++++-- man/hepExplorer.Rd | 16 ++++++++++++---- man/paneledOutlierExplorer.Rd | 12 ++++++++++-- 6 files changed, 46 insertions(+), 13 deletions(-) diff --git a/.Rbuildignore b/.Rbuildignore index 1ee2a44..181c72e 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -9,3 +9,4 @@ cran-comments.md ^CRAN-RELEASE$ ^CRAN-SUBMISSION$ ^docs$ +^inst/sandbox$ diff --git a/DESCRIPTION b/DESCRIPTION index 8747e5a..d85b180 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -9,7 +9,7 @@ Authors@R: email = "jwildfire@gmail.com" ) Maintainer: Jeremy Wildfire -Description: Contains chart code for monitoring clinical trial safety. Charts can be used as standalone output, but are also designed for use with the 'safetyGraphics' package, which makes it easy to load data and customize the charts using an interactive web-based interface created with Shiny. +Description: Contains chart code for monitoring clinical trial safety. Charts can be used as standalone output, but are also designed for use with the 'safetyGraphics' package, which makes it easy to load data and customize the charts using an interactive web-based interface created with 'Shiny'. URL: https://github.com/SafetyGraphics/safetyCharts BugReports: https://github.com/SafetyGraphics/safetyCharts/issues License: MIT + file LICENSE diff --git a/R/hepExplorer.R b/R/hepExplorer.R index db70306..39499f4 100644 --- a/R/hepExplorer.R +++ b/R/hepExplorer.R @@ -36,18 +36,26 @@ #' For more options see the [full specs](https://github.com/SafetyGraphics/hep-explorer/wiki/Configuration) in the javascript library. #' #' @examplesIf requireNamespace("safetyData", quietly = TRUE) +#' # A 20-subject slice of the bundled lab data. The examples below use it so +#' # that each one renders in a fraction of a second; `hepExplorer()` with no +#' # arguments uses all 254 subjects of `safetyData::adam_adlbc`. +#' adlbc <- safetyData::adam_adlbc +#' adlbc <- adlbc[adlbc$USUBJID %in% unique(adlbc$USUBJID)[1:20], ] +#' #' # Render widget with defaults -#' hepExplorer() +#' hepExplorer(data = adlbc) #' #' # Add age group to default -#' hepExplorer(group_cols=c("SEX","AGEGR1")) +#' hepExplorer(data = adlbc, group_cols=c("SEX","AGEGR1")) #' #' # Enable interactive y-axis -#' hepExplorer(y_options='all') +#' hepExplorer(data = adlbc, y_options='all') #' #' # Use custom mapping for SDTM data +#' lb <- safetyData::sdtm_lb +#' lb <- lb[lb$USUBJID %in% unique(lb$USUBJID)[1:20], ] #' hepExplorer( -#' data=safetyData::sdtm_lb, +#' data=lb, #' measure_col = "LBTEST", #' measure_values = list( #' ALT = "Alanine Aminotransferase", diff --git a/R/paneledOutlierExplorer.R b/R/paneledOutlierExplorer.R index a1560a6..0142561 100644 --- a/R/paneledOutlierExplorer.R +++ b/R/paneledOutlierExplorer.R @@ -43,11 +43,18 @@ #' For more options see the [full specs](https://github.com/rhoinc/paneled-outlier-explorer/wiki/Configuration) in the javascript library. #' #' @examplesIf requireNamespace("safetyData", quietly = TRUE) +#' # A 20-subject slice of the bundled lab data. The examples below use it so +#' # that each one renders in a fraction of a second; `paneledOutlierExplorer()` +#' # with no arguments uses all 254 subjects of `safetyData::adam_adlbc`. +#' adlbc <- safetyData::adam_adlbc +#' adlbc <- adlbc[adlbc$USUBJID %in% unique(adlbc$USUBJID)[1:20], ] +#' #' # Render widget with defaults -#' paneledOutlierExplorer() +#' paneledOutlierExplorer(df = adlbc) #' #' # Add Sex and Age Filters #' paneledOutlierExplorer( +#' df = adlbc, #' filters=list( #' list(value_col="SEX"), #' list(value_col="AGEGR1",label="Age") @@ -55,10 +62,11 @@ #' ) #' #' # customize panel size (in pixels) -#' paneledOutlierExplorer(multiples_sizing=list("width"= 500,"height"= 300)) +#' paneledOutlierExplorer(df = adlbc, multiples_sizing=list("width"= 500,"height"= 300)) #' #' # customize default normal range #' paneledOutlierExplorer( +#' df = adlbc, #' normal_range_method = 'quantiles', #' normal_range_quantile_low = 0.2, #' normal_range_quantile_high = 0.8, diff --git a/man/hepExplorer.Rd b/man/hepExplorer.Rd index a73ddfd..3b4b61b 100644 --- a/man/hepExplorer.Rd +++ b/man/hepExplorer.Rd @@ -56,18 +56,26 @@ For more options see the \href{https://github.com/SafetyGraphics/hep-explorer/wi } \examples{ \dontshow{if (requireNamespace("safetyData", quietly = TRUE)) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} +# A 20-subject slice of the bundled lab data. The examples below use it so +# that each one renders in a fraction of a second; `hepExplorer()` with no +# arguments uses all 254 subjects of `safetyData::adam_adlbc`. +adlbc <- safetyData::adam_adlbc +adlbc <- adlbc[adlbc$USUBJID \%in\% unique(adlbc$USUBJID)[1:20], ] + # Render widget with defaults -hepExplorer() +hepExplorer(data = adlbc) # Add age group to default -hepExplorer(group_cols=c("SEX","AGEGR1")) +hepExplorer(data = adlbc, group_cols=c("SEX","AGEGR1")) # Enable interactive y-axis -hepExplorer(y_options='all') +hepExplorer(data = adlbc, y_options='all') # Use custom mapping for SDTM data +lb <- safetyData::sdtm_lb +lb <- lb[lb$USUBJID \%in\% unique(lb$USUBJID)[1:20], ] hepExplorer( - data=safetyData::sdtm_lb, + data=lb, measure_col = "LBTEST", measure_values = list( ALT = "Alanine Aminotransferase", diff --git a/man/paneledOutlierExplorer.Rd b/man/paneledOutlierExplorer.Rd index 39ec87b..4e8e097 100644 --- a/man/paneledOutlierExplorer.Rd +++ b/man/paneledOutlierExplorer.Rd @@ -64,11 +64,18 @@ For more options see the \href{https://github.com/rhoinc/paneled-outlier-explore } \examples{ \dontshow{if (requireNamespace("safetyData", quietly = TRUE)) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} +# A 20-subject slice of the bundled lab data. The examples below use it so +# that each one renders in a fraction of a second; `paneledOutlierExplorer()` +# with no arguments uses all 254 subjects of `safetyData::adam_adlbc`. +adlbc <- safetyData::adam_adlbc +adlbc <- adlbc[adlbc$USUBJID \%in\% unique(adlbc$USUBJID)[1:20], ] + # Render widget with defaults -paneledOutlierExplorer() +paneledOutlierExplorer(df = adlbc) # Add Sex and Age Filters paneledOutlierExplorer( + df = adlbc, filters=list( list(value_col="SEX"), list(value_col="AGEGR1",label="Age") @@ -76,10 +83,11 @@ paneledOutlierExplorer( ) # customize panel size (in pixels) -paneledOutlierExplorer(multiples_sizing=list("width"= 500,"height"= 300)) +paneledOutlierExplorer(df = adlbc, multiples_sizing=list("width"= 500,"height"= 300)) # customize default normal range paneledOutlierExplorer( + df = adlbc, normal_range_method = 'quantiles', normal_range_quantile_low = 0.2, normal_range_quantile_high = 0.8,