Skip to content

Instantly share code, notes, and snippets.

@dlebauer
Created July 27, 2021 18:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dlebauer/37d5e389f7c4b12ac474d328b3edf3d8 to your computer and use it in GitHub Desktop.
Save dlebauer/37d5e389f7c4b12ac474d328b3edf3d8 to your computer and use it in GitHub Desktop.
code to download and unzip trait data from Dryad and then plot it
library(ggplot2)
library(dplyr)
download.file(url = 'https://datadryad.org/stash/downloads/file_stream/624637', destfile = 'trait_data.zip', mode = 'wb')
unzip(zipfile = 'trait_data.zip', unzip = 'unzip')
s6heights <- readr::read_csv('traits/season_6_traits/season_6_canopy_height_sensor.csv')
s4heights <- readr::read_csv('traits/season_4_traits/season_4_canopy_height_sensor.csv')
heights <- bind_rows(s4heights, s6heights)
head(heights)
theme_set(theme_minimal())
ggplot(data = heights, aes(x = date, y = mean)) +
geom_point(alpha = 0.1, size = 0.1, color = 'blue') +
geom_line(aes(group = plot), alpha = 0.1) +
facet_wrap(~season, scales = 'free_x', ncol = 1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment