Last active
March 20, 2017 21:24
-
-
Save jsta/b3084025150b4a54542f84e8266b0f51 to your computer and use it in GitHub Desktop.
Automated viz of Oneida Lake benthos data from dataone
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(dataone) | |
cn <- CNode("PROD") | |
mn <- getMNode(cn, "urn:node:KNB") | |
dt <- getPackage(mn, id = "resourceMap_kgordon.4.57") | |
unzip(dt) | |
# list.files("resourceMap_kgordon_4_57/data") | |
dt <- read.csv("resourceMap_kgordon_4_57/data/cbfs.140.3-Oneida_Benthos_1956_to_present.csv", | |
stringsAsFactors = FALSE) | |
# Plot data #### | |
library(dplyr) | |
library(ggplot2) | |
dt <- group_by(dt, Year) | |
dt <- summarise_each(dt, funs(mean), 5:17) | |
dt <- reshape2::melt(dt, "Year") | |
gg <- ggplot(data = dt) + | |
geom_line(aes(x = Year, y = value)) + | |
facet_wrap(~variable) | |
gg |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment