Here's a jupyter notebook demonstrating how to read in and plot an ROI (Region of Interest) summary using R. In this case I'm using the 3-day summary file from the alligatorriver site. The summary files are in CSV format and can be read directly from the site using a URL.
In [1]:
library(ggplot2)
library(lubridate)
baseurl = 'http://klima.sr.unh.edu/data/archive'
sitename = 'alligatorriver'
roiname1 = 'DB_0001'
csvfile = sprintf("%s_%s_3day.csv",sitename,roiname1)
csvurl = sprintf("%s/%s/ROI/%s",baseurl,sitename,csvfile)
df = read.csv(url(csvurl),comment.char="#",header=TRUE)
df$date = as.Date(df$date)
df$year = year(df$date)
ystart = min(df$year)
yend = max(df$year)
df$year = factor(df$year,levels=seq(ystart,yend))
head(df)
In [2]:
options(repr.plot.width = 8)
options(repr.plot.height = 2.5)
p = ggplot(df,aes(x=date,y=gcc_90)) + geom_line(col='green') + geom_point(size=.5, na.rm=TRUE)
p
In [4]:
## plot gcc_90 vs doy for each year
options(repr.plot.width = 8)
options(repr.plot.height = 3.0)
df$year = factor(df$year,levels=seq(ystart,yend))
p = ggplot(df,aes(x=doy,y=gcc_90,col=year)) + geom_line(alpha=.5, na.rm=TRUE)
p = p + geom_point(alpha=.5, na.rm=TRUE)
p
In [ ]: