### read NCDC data
library(dygraphs)
csv.path <- "http://spatial.binghamton.edu/PPR/PPR_NCDC_1895_2015.csv"
df <- read.csv(csv.path)
PHDI <- ts(df$PHDI,start = c(1895,1),frequency = 12)
PCP <- ts(df$PCP,start = c(1895,1),frequency = 12)
dygraph(PHDI, main = "Palmer Hydrological Drought Index (PHDI) in the Pipestem (1895-2016)") %>% 
  dyRangeSelector(dateWindow = c("1895-01-01", "2016-01-01"))

        Use the slider to zoom in and zoom out; double click the chart to return to full extent



dygraph(PCP, main = "Precipitation Index in the Pipestem (1895-2016)") %>% 
  dyRangeSelector(dateWindow = c("1895-01-01", "2016-01-01"))

        Use the slider to zoom in and zoom out; double click the chart to return to full extent

LS0tDQp0aXRsZTogIkludGVyYWN0aXZlIGdyYXBocyBjcmVhdGVkIHVzaW5nIFIiDQpvdXRwdXQ6IGh0bWxfbm90ZWJvb2sNCiAgI2h0bWxfZG9jdW1lbnQNCiAgICAjIHRvYzogdHJ1ZQ0KICAgICMgdG9jX2Zsb2F0OiB0cnVlDQotLS0NCg0KPHN0eWxlPg0KLm1haW4tY29udGFpbmVyIHsgd2lkdGg6IDEwMCU7IG1heC13aWR0aDoyODAwcHg7aGVpZ2h0OjEwMCV9DQo8L3N0eWxlPg0KDQoNCmBgYHtyIG1lc3NhZ2UgPSBGQUxTRSwgd2FybmluZ3MgPSBGQUxTRSxmaWcud2lkdGg9MTJ9DQojIyMgcmVhZCBOQ0RDIGRhdGENCmxpYnJhcnkoZHlncmFwaHMpDQpjc3YucGF0aCA8LSAiaHR0cDovL3NwYXRpYWwuYmluZ2hhbXRvbi5lZHUvUFBSL1BQUl9OQ0RDXzE4OTVfMjAxNS5jc3YiDQpkZiA8LSByZWFkLmNzdihjc3YucGF0aCkNClBIREkgPC0gdHMoZGYkUEhESSxzdGFydCA9IGMoMTg5NSwxKSxmcmVxdWVuY3kgPSAxMikNClBDUCA8LSB0cyhkZiRQQ1Asc3RhcnQgPSBjKDE4OTUsMSksZnJlcXVlbmN5ID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