Growth Lab

Love Vaishnav
27 October 2026

An interactive Shiny application for exploring vitamin C dose and supplement differences.

A reproducible introduction to group comparisons.

The experiment

Growth Lab helps beginning R users explore an experiment without writing analysis code.

  • 60 guinea pigs, with one response per animal.
  • Three doses: 0.5, 1 and 2 mg/day.
  • Two supplements: orange juice (OJ) and ascorbic acid (VC).
  • Response: odontoblast length, recorded as len.

Each supplement/dose group contains 10 animals. The app preserves the recorded response scale because R's documentation does not specify a physical unit.

Source: Official R ToothGrowth documentation

Interactive comparisons

Users choose a dose and select one or both supplements. They can also show individual observations on the boxplot.

The application responds immediately:

  • server.R filters the selected observations.
  • Reactive calculations update counts, means, medians and standard deviations.
  • The chart and tables display the updated results.
  • A comparison table reports OJ mean minus VC mean at each dose.

The How to use tab contains instructions, definitions and a worked example. Users can download the selected records as CSV.

A calculation you can reproduce

m <- with(tg, tapply(len, list(dose, supp), mean))
result <- data.frame(Dose = as.numeric(rownames(m)), m)
result$Difference <- result$OJ - result$VC
knitr::kable(result, "html", digits = 2, row.names = FALSE)
Dose OJ VC Difference
0.5 13.23 7.98 5.25
1.0 22.70 16.77 5.93
2.0 26.06 26.14 -0.08

At 0.5 mg/day, the OJ mean exceeds the VC mean by 5.25 on the recorded scale.

The R code calculates this table when the presentation is built. These descriptive results from guinea pigs do not establish effects in humans.

Try Growth Lab

Open the live Shiny application

  1. Choose 0.5 mg/day and keep both supplements selected.
  2. Confirm 20 animals, group means of 13.23 and 7.98, and a difference of 5.25.
  3. Change the dose to 2 mg/day and compare the updated results.
  4. Read How to use for interpretation and limitations.

View the ui.R and server.R source on GitHub