Skip to content

Instantly share code, notes, and snippets.

@kjhealy
Last active March 15, 2023 11:38
Show Gist options
  • Save kjhealy/877314bca843c80b2703d8577687e144 to your computer and use it in GitHub Desktop.
Save kjhealy/877314bca843c80b2703d8577687e144 to your computer and use it in GitHub Desktop.
library(tidyverse)
url <- "https://caphector.com/co2.csv"
df <- read_csv(url) |>
mutate(Time = paste0("2023/", Time),
Time = lubridate::as_datetime(Time))
df |>
pivot_longer(`CO2 (SCD40)`:`Altitude (BME)`) |>
ggplot(mapping = aes(x = Time,
y = value,
color = name)) +
geom_line() +
facet_wrap(~ name, ncol = 1,
scales = "free_y") +
guides(color = "none") +
labs(title = "A Week of CO2",
subtitle = "Note that the y-axis of each panel is on its own scale",
y = "Value")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment