Learn R Programming

forestly

Installation

The easiest way to get forestly is to install from CRAN:

install.packages("forestly")

Alternatively, to use a new feature or get a bug fix, you can install the development version of forestly from GitHub:

# install.packages("remotes")
remotes::install_github("Merck/forestly")

Overview

The forestly package creates interactive forest plots for clinical trial analysis & reporting.

  • Safety analysis
    • Specific adverse events analysis
  • Efficacy analysis (future work)
    • Subgroup analysis

We assume ADaM datasets are ready for analysis and leverage metalite data structure to define inputs and outputs.

Workflow

The general workflow is:

  1. meta_forestly() constructs input metadata for treatment analysis from ADaM datasets.
  2. prepare_ae_forestly() prepares datasets for interactive forest plot.
  3. format_ae_forestly() formats output layout.
  4. ae_forestly() generates an interactive forest plot.

Here is a quick example

library("forestly")

meta_forestly(
  dataset_adsl = forestly_adsl,
  dataset_adae = forestly_adae,
  parameter_term = "any;rel;ser",
  population_subset = SAFFL == "Y",
  observation_subset = SAFFL == "Y"
) |>
  prepare_ae_forestly(parameter = "any;rel;ser") |>
  format_ae_forestly() |>
  ae_forestly()

Interactive features

The interactive features for safety analysis include:

  • Select different AE criteria.
  • Filter by incidence of AE in one or more groups.
  • Reveal information by hovering the mouse over a data point.
  • Search bars to find subjects with selected adverse events (AEs).
  • Sort value by clicking the column header.
  • Drill-down listing by clicking $\blacktriangleright$.

References

Copy Link

Version

Install

install.packages('forestly')

Monthly Downloads

516

Version

0.1.2

License

GPL (>= 3)

Issues

Pull Requests

Stars

Forks

Maintainer

Benjamin Wang

Last Published

January 10th, 2025

Functions in forestly (0.1.2)

theme_panel

Theme function for plot with multiple panels
forestly_adsl

A subject level demographic dataset
plot_dot

Dot plot
format_ae_forestly

Format outdata for interactive forest plot
meta_forestly

Create metadata for interactive forest plot
plot_errorbar

Plot to display risk difference
prepare_ae_forestly

Prepare datasets for interactive forest plot
background_panel

Add background for creating plot with customized color
ae_forestly

Display interactive forest plot
table_panel

Create table panel ggplot2 object for rainfall or forest plot
forestly_adsl_3grp

A subject level demographic dataset
forestly_adae_3grp

An adverse event dataset
forestly_adae

An adverse event dataset