Commit 08b5f3d6 authored by andy.disch's avatar andy.disch

Add new file

parent c199b2f7
---
title: "datValX_dataIllustration"
author: "adisch"
date: "September 11, 2018"
output: html_document
---
```{r setup, include = FALSE}
rm(list = ls())
library(DatapoolR)
library(lubridate)
library(dplyr)
library(reshape2)
library(ggplot2)
library(xts)
library(dygraphs)
```
# Illustration of the data collected in UWO
```{r export}
source.name <- list.sources()$instance
parameter.name <- "flow rate"
from <- "2017-06-22 00:00:00"
to <- "2017-06-29 23:59:59"
step <- "5 minutes"
df <- data.frame(time = seq.POSIXt(as.POSIXct(from), as.POSIXct(to), by = "5 min"))
for(i in c(35, 40, 41, 42)){
tmp <- tryCatch(signals.of.source(source.name[i], from, to, parameter.name)[ ,1:2],
error = function(e) { return(NA) })
if(!is.na(tmp)) {
tmp$time <- round_date(tmp$time, step)
df <- left_join(df, tmp, by = "time")
}
}
dygraph(xts(df[ ,-1], order.by = df$time)) %>%
dyOptions(useDataTimezone = TRUE) %>%
dyRangeSelector() %>%
dyLegend(width = 0) %>%
dyOptions(axisLineWidth = 1.5)
```
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment