tsibble-wrap: A shiny module to easily slice and dice tsibble index for...

Description Usage Arguments Examples

Description

A pair of UI and server functions: tsibbleWrapUI() and tsibbleWrapServer().

Usage

1
2
3

Arguments

id

A unique shiny id.

plot

A ggplot or plotly object.

period

A string passed to lubridate::period() to specify the minimum seasonal period, for example "1 day".

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
if (interactive()) {
  library(tsibble)
  library(dplyr)
  library(shiny)
  library(ggplot2)
  p <- tourism %>%
    filter(Region %in% c("Melbourne", "Sydney")) %>%
    ggplot(aes(x = Quarter, y = Trips, colour = Region)) +
    geom_line() +
    facet_wrap(~ Purpose, scales = "free_y") +
    theme(legend.position = "none")

  ui <- fluidPage(tsibbleWrapUI("dice"))
  server <- function(input, output, session) {
    tsibbleWrapServer("dice", p, period = "1 year")
  }
  shinyApp(ui, server)
}

Example output

sh: 1: timedatectl: Permission denied
Error in file(con, "r") : cannot open the connection
In addition: Warning messages:
1: In system("timedatectl", intern = TRUE) :
  running command 'timedatectl' had status 126
2: In file(con, "r") : cannot open file '/etc/timezone': Permission denied

tsibbletalk documentation built on Oct. 23, 2020, 8:09 p.m.