vis_ts | R Documentation |
Interactive visualisation and exploration of one dimensional time series, based on pretty_ts
.
vis_ts(data)
data |
A dataframe containing a response variable, time stamps (and, optionally) explanatory variables. Time stamps can be integer/numeric, |
An interactive R Shiny application for visualising time series.
Edward Lavender
## Not run:
#### Example (1) Visualising POSIXct time series
# Here we have a simple dataframe... other columns (i.e. covariates) can be included
# ... alongside factor columns.
x <- seq.POSIXt(as.POSIXct("2016-01-01", tz = "UTC"),
as.POSIXct("2016-01-10", tz = "UTC"), by = "2 hours")
y1 <- rnorm(length(x), 200, 25) *-1
y2 <- rnorm(length(x), lubridate::yday(x) * 0.5 +20, 0.5)
dat <- data.frame(x = x, y1 = y1, y2 = y2)
#### Launch shiny
vis_ts(data = dat)
## End(Not run)
## Not run:
#### Example (2) Visualising numeric time series
x <- 1:1000
y <- rnorm(length(x), x*0.1- 500, 1000)
y2 <- rnorm(length(x), x*0.5, 500)
vis_ts(data = data.frame(x = x, y = y, y2 = y2))
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.