webforest includes four datasets for examples, testing, and learning. Each is designed to showcase different features and use cases.

Available Datasets

Dataset Rows Domain Key Features
glp1_trials 24 Clinical trials HR/CI, groups, subgroups, summary rows
airline_delays 40 Transportation Sparkline trends, bar charts, grouped
nba_efficiency 30 Sports Player stats, conference groups, badges
climate_temps 20 Science Minimal structure, uncertainty ranges

glp1_trials

GLP-1 agonist cardiovascular outcomes trials - ideal for meta-analysis examples.

Code
data(glp1_trials)
glimpse(glp1_trials)
Rows: 24
Columns: 13
$ study    <chr> "SUSTAIN-6", "PIONEER 6", "LEADER", "REWIND", "EXSCEL", "AMPL…
$ drug     <chr> "Semaglutide 1mg", "Oral Semaglutide", "Liraglutide", "Dulagl…
$ year     <dbl> 2016, 2019, 2016, 2019, 2017, 2021, 2015, 2018, 2016, 2024, 2…
$ n        <dbl> 3297, 3183, 9340, 9901, 14752, 4076, 6068, 9463, 4156, 9650, …
$ events   <dbl> 108, 137, 608, 594, 839, 189, 406, 338, 97, 510, 550, 620, 17…
$ hr       <dbl> 0.74, 0.79, 0.87, 0.88, 0.91, 0.73, 1.02, 0.78, 0.98, 0.86, 0…
$ lower    <dbl> 0.58, 0.57, 0.78, 0.79, 0.83, 0.58, 0.89, 0.68, 0.65, 0.76, 0…
$ upper    <dbl> 0.95, 1.11, 0.97, 0.99, 1.00, 0.92, 1.17, 0.90, 1.48, 0.98, 0…
$ pvalue   <dbl> 0.0160, 0.1700, 0.0100, 0.0260, 0.0600, 0.0070, 0.8100, 0.000…
$ endpoint <chr> "MACE", "MACE", "MACE", "MACE", "MACE", "MACE", "MACE", "MACE…
$ row_type <chr> "data", "data", "data", "data", "data", "data", "data", "data…
$ row_bold <lgl> FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE…
$ group    <chr> "Main Trials", "Main Trials", "Main Trials", "Main Trials", "…

Best for: Meta-analyses, subgroup analyses, publication-style forest plots

Code
# Filter to main trials only
glp1_trials |>
  filter(group == "Main Trials") |>
  forest_plot(
    label = "study",
    point = "hr",
    lower = "lower",
    upper = "upper",
    columns = list(
      col_text("drug", "Drug"),
      col_n("n"),
      col_interval("HR (95% CI)")
    ),
    scale = "log",
    null_value = 1,
    theme = web_theme_lancet(),
    axis_label = "Hazard Ratio",
    title = "GLP-1 Agonist Cardiovascular Outcomes"
  )

airline_delays

Airline carrier performance data with trends - ideal for sparklines and bar charts.

Code
data(airline_delays)
glimpse(airline_delays)
Rows: 40
Columns: 10
$ carrier      <chr> "Alaska", "Alaska", "Alaska", "Alaska", "Allegiant", "All…
$ carrier_type <chr> "Legacy", "Legacy", "Legacy", "Legacy", "Ultra Low-Cost",…
$ month        <chr> "Apr", "Feb", "Jan", "Mar", "Apr", "Feb", "Jan", "Mar", "…
$ delay_vs_avg <dbl> -4.9, -3.2, -5.1, -1.8, 6.4, 2.0, 4.8, 3.6, 3.4, 0.7, 2.9…
$ on_time_pct  <dbl> 86.4, 86.7, 83.4, 87.3, 79.4, 74.5, 77.7, 76.0, 74.8, 78.…
$ satisfaction <dbl> 4.5, 4.1, 4.1, 4.9, 3.0, 2.3, 3.0, 2.6, 3.4, 3.1, 3.2, 2.…
$ flights      <dbl> 19267, 13080, 29086, 25335, 21556, 23170, 19367, 26558, 3…
$ delay_lower  <dbl> -6.89125903, -5.36685429, -7.32565221, -3.39057838, 3.413…
$ delay_upper  <dbl> -2.86032213, -1.56362254, -2.98630186, 0.89789496, 8.6057…
$ trend        <list> <-4.7, -4.7, -4.2, -4.2, -5.9, -5.1, -4.7, -5.0, -4.9, -…

Best for: Sparkline columns, bar charts, grouped comparisons

Code
# Aggregate to carrier level for cleaner display
airline_summary <- airline_delays |>
  group_by(carrier) |>
  summarise(
    delay_vs_avg = mean(delay_vs_avg),
    delay_lower = mean(delay_lower),
    delay_upper = mean(delay_upper),
    on_time_pct = mean(on_time_pct),
    trend = list(unlist(trend[1]))
  )

forest_plot(
  airline_summary,
  label = "carrier",
  point = "delay_vs_avg",
  lower = "delay_lower",
  upper = "delay_upper",
  columns = list(
    col_percent("on_time_pct", "On-Time %"),
    col_sparkline("trend", "12M Trend"),
    col_interval("Delay (95% CI)")
  ),
  null_value = 0,
  theme = web_theme_modern(),
  axis_label = "Delay vs. Average (minutes)",
  title = "Airline Carrier Performance"
)

nba_efficiency

NBA player statistics - a fun dataset for demonstrating grouped data and badges.

Code
data(nba_efficiency)
glimpse(nba_efficiency)
Rows: 30
Columns: 11
$ player     <chr> "Nikola Jokic", "Luka Doncic", "Giannis Antetokounmpo", "Jo…
$ team       <chr> "DEN", "DAL", "MIL", "PHI", "OKC", "BOS", "MIN", "CLE", "SA…
$ conference <chr> "West", "West", "West", "West", "West", "East", "East", "Ea…
$ position   <chr> "C", "G", "F", "C", "G", "F", "G", "G", "G", "G", "F", "F",…
$ games      <dbl> 79, 70, 73, 39, 75, 74, 79, 55, 74, 69, 71, 75, 74, 68, 9, …
$ ppg        <dbl> 26.4, 33.9, 30.4, 34.7, 30.1, 26.9, 25.9, 26.6, 26.6, 20.1,…
$ per        <dbl> 31.5, 27.8, 29.5, 31.2, 25.4, 23.1, 22.3, 24.2, 22.5, 19.8,…
$ per_lower  <dbl> 29.9, 26.0, 26.9, 28.4, 22.7, 21.1, 20.7, 22.3, 20.6, 17.7,…
$ per_upper  <dbl> 34.5, 29.6, 32.4, 33.5, 27.9, 26.0, 25.3, 27.1, 25.4, 22.1,…
$ all_star   <lgl> TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE,…
$ award      <chr> "MVP", "All-NBA 1st", "All-NBA 1st", "All-NBA 2nd", "All-NB…

Best for: Grouped data, badges, non-medical examples

Code
forest_plot(
  nba_efficiency,
  label = "player",
  point = "per",
  lower = "per_lower",
  upper = "per_upper",
  group = "conference",
  columns = list(
    col_text("team", "Team", width = 60),
    col_numeric("ppg", "PPG"),
    col_interval("PER (95% CI)")
  ),
  row_badge = "award",
  null_value = 15,  # League average PER
  theme = web_theme_modern(),
  axis_label = "Player Efficiency Rating",
  title = "NBA Player Efficiency",
  subtitle = "2023-24 Season",
  caption = "PER: 15 = league average"
)

climate_temps

Regional temperature anomalies - minimal dataset for clean examples.

Code
data(climate_temps)
glimpse(climate_temps)
Rows: 20
Columns: 7
$ region    <chr> "Global", "Northern Hemisphere", "Southern Hemisphere", "Arc…
$ period    <chr> "2023", "2023", "2023", "2023", "2023", "2023", "2023", "202…
$ anomaly   <dbl> 1.45, 1.62, 1.28, 2.85, 0.45, 1.78, 2.10, 1.65, 1.35, 1.20, …
$ lower     <dbl> 1.38, 1.52, 1.18, 2.55, 0.30, 1.58, 1.88, 1.45, 1.18, 1.02, …
$ upper     <dbl> 1.52, 1.72, 1.38, 3.15, 0.60, 1.98, 2.32, 1.85, 1.52, 1.38, …
$ certainty <chr> "High", "High", "High", "Medium", "Medium", "High", "High", …
$ category  <chr> "Global", "Hemisphere", "Hemisphere", "Polar", "Polar", "Con…

Best for: Simple examples, minimal themes, uncertainty visualization

Code
climate_temps |>
  filter(category %in% c("Global", "Hemisphere", "Continental")) |>
  forest_plot(
    label = "region",
    point = "anomaly",
    lower = "lower",
    upper = "upper",
    group = "category",
    columns = list(
      col_text("certainty", "Confidence"),
      col_interval("Anomaly (95% CI)")
    ),
    null_value = 0,
    theme = web_theme_minimal(),
    axis_label = "Temperature Anomaly (°C)",
    title = "Regional Temperature Anomalies",
    subtitle = "2023 vs. Pre-Industrial Baseline"
  )

Using Datasets in Your Code

All datasets are lazy-loaded. Simply reference them after loading the package:

library(webforest)

# Datasets are available immediately
head(glp1_trials)

# Or explicitly load
data(glp1_trials)

See ?glp1_trials, ?airline_delays, ?nba_efficiency, and ?climate_temps for full documentation.