vis_ts: Visualise one dimensional time series via R Shiny

View source: R/vis_ts.R

vis_tsR Documentation

Visualise one dimensional time series via R Shiny

Description

Interactive visualisation and exploration of one dimensional time series, based on pretty_ts.

Usage

vis_ts(data)

Arguments

data

A dataframe containing a response variable, time stamps (and, optionally) explanatory variables. Time stamps can be integer/numeric, DateTimeClasses or a Date objects.

Value

An interactive R Shiny application for visualising time series.

Author(s)

Edward Lavender

Examples

## 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)


edwardlavender/prettyGraphics documentation built on Jan. 19, 2025, 2:47 p.m.