Test R Markdown

# Set your local data here. note that when used in teal the `data` must be available to the module
CO2 <- datasets::CO2 # nolint: object_name_linter.

Data preparation

# Convert Treatment and Type to factors (if not already)
CO2$Treatment <- as.factor(CO2$Treatment) # nolint: object_name_linter.
CO2$Type <- as.factor(CO2$Type) # nolint: object_name_linter.

Uptake by Plant Type and Treatment

library(dplyr)
# Summarize mean uptake by Type and Treatment
CO2 |>
  group_by(Type, Treatment) |>
  summarise(mean_uptake = mean(uptake), .groups = "drop")

Visualization: Uptake by Concentration

library(ggplot2)
ggplot(CO2, aes(x = conc, y = uptake, color = Treatment, shape = Type)) +
  geom_point() +
  geom_smooth(formula = "y ~ x", method = "lm", se = FALSE) +
  labs(
    title = "CO2 Uptake vs. Concentration",
    x = "CO2 Concentration (mL/L)",
    y = "CO2 Uptake (umol/m^2 sec)",
    color = "Treatment",
    shape = "Plant Type"
  ) +
  theme_minimal()

Visualization: Uptake Distribution by Plant

ggplot(CO2, aes(x = Plant, y = uptake, fill = Treatment)) +
  geom_boxplot() +
  labs(
    title = "CO2 Uptake Distribution by Plant",
    x = "Plant",
    y = "CO2 Uptake (umol/m^2 sec)",
    fill = "Treatment"
  ) +
  theme_minimal()


Try the teal.modules.general package in your browser

Any scripts or data that you put into this service are public.

teal.modules.general documentation built on Aug. 2, 2026, 1:06 a.m.