Created
July 27, 2021 18:21
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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