tabviz includes five 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
effect_sizes 20 Stress test Extreme CIs, split testing, regions/outcomes

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

Example

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

Variables

Variable Description
study Trial name and year
drug GLP-1 agonist name
hr, lower, upper Hazard ratio and 95% CI
n, events Sample size and event count
pvalue P-value
group Trial grouping (Main Trials, Subgroups)
row_type, row_bold Pre-computed row styling

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> 0.864, 0.867, 0.834, 0.873, 0.794, 0.745, 0.777, 0.760, 0…
$ 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

Example

Code
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]))
  )

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

Variables

Variable Description
carrier Airline name
delay_vs_avg, delay_lower, delay_upper Delay vs industry average and 95% CI
on_time_pct Proportion of on-time arrivals (0-1)
satisfaction Customer satisfaction (1-5)
flights Number of flights
trend List-column with 12-month delay trend
carrier_type Carrier category (Major, Regional, Budget)

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

Example

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

Variables

Variable Description
player Player name
team, position Team abbreviation and position
conference Eastern or Western
per, per_lower, per_upper Player Efficiency Rating and 95% CI
ppg, games Points per game and games played
award Major awards (MVP, DPOY, etc.) for badge display

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

Example

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

Variables

Variable Description
region Geographic region name
category Region type (Global, Hemisphere, Continental, Ocean)
anomaly, lower, upper Temperature anomaly and uncertainty
certainty Confidence level (High, Medium, Low)

effect_sizes

A stress-test dataset designed to test forest plot axis rendering with varying confidence interval widths.

Code
data(effect_sizes)
glimpse(effect_sizes)
Rows: 20
Columns: 12
$ study       <chr> "Major Medical Center A", "University Hospital B", "Nation…
$ region      <chr> "North America", "North America", "Europe", "Europe", "Asi…
$ outcome     <chr> "Primary", "Primary", "Primary", "Primary", "Primary", "Pr…
$ treatment   <chr> "Drug A", "Drug A", "Drug A", "Drug A", "Drug A", "Drug A"…
$ phase       <chr> "Phase 3", "Phase 3", "Phase 3", "Phase 3", "Phase 3", "Ph…
$ n           <dbl> 2500, 1800, 3200, 1500, 2100, 450, 380, 520, 290, 410, 85,…
$ hr          <dbl> 0.72, 0.78, 0.81, 0.76, 0.84, 0.68, 0.92, 0.71, 1.05, 0.88…
$ lower       <dbl> 0.702, 0.762, 0.793, 0.737, 0.821, 0.643, 0.873, 0.681, 0.…
$ upper       <dbl> 0.739, 0.798, 0.827, 0.784, 0.860, 0.719, 0.970, 0.741, 1.…
$ se          <dbl> 0.01302166, 0.01169697, 0.01067924, 0.01573598, 0.01172054…
$ significant <lgl> TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, TRU…
$ direction   <chr> "Favors Treatment", "Favors Treatment", "Favors Treatment"…

Best for: Testing axis calculation, split views, extreme CIs, multi-forest columns

Example

Code
# Group by region and show effect sizes with marker styling
effect_sizes |>
  filter(outcome == "Primary") |>
  tabviz(
    label = "study",
    group = "region",
    columns = list(
      col_n("n"),
      viz_forest(point = "hr", lower = "lower", upper = "upper",
                 scale = "log", null_value = 1, width = 200)
    ),
    marker_color = ~ ifelse(significant, "#16a34a", "#94a3b8"),
    theme = web_theme_modern(),
    title = "Effect Sizes by Region"
  )

Variables

Variable Description
study Study or site name
region Geographic region (North America, Europe, Asia Pacific)
outcome Outcome type (Primary, Secondary, Exploratory)
treatment Treatment arm
hr, lower, upper Hazard ratio and 95% CI
significant Whether CI excludes 1.0
direction Effect direction (Favors Treatment, Favors Control)

Using Datasets

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

library(tabviz)

# Datasets are available immediately
head(glp1_trials)

# Or explicitly load
data(glp1_trials)

Documentation

See help files for full variable descriptions:

  • ?glp1_trials
  • ?airline_delays
  • ?nba_efficiency
  • ?climate_temps

See Also

  • Gallery — Full examples using these datasets
  • Columns — Column types for displaying data
  • Themes — Theme options for styling