Title: | Interactive Graphics for Tsibble Objects |
---|---|
Description: | A shared tsibble data easily communicates between htmlwidgets on both client and server sides, powered by 'crosstalk'. A shiny module is provided to visually explore periodic/aperiodic temporal patterns. |
Authors: | Earo Wang [aut, cre] , Di Cook [aut] |
Maintainer: | Earo Wang <[email protected]> |
License: | GPL-3 |
Version: | 0.1.0.9000 |
Built: | 2024-11-11 03:29:35 UTC |
Source: | https://github.com/earowang/tsibbletalk |
Plot nesting structures in shared tsibbles using plotly
plotly_key_tree(data, height = NULL, width = NULL, ...)
plotly_key_tree(data, height = NULL, width = NULL, ...)
data |
A shared tsibble. |
height |
height |
width |
width |
... |
arguments supplied to |
if (interactive()) { shared_tourism <- as_shared_tsibble(tourism_monthly, spec = (State / Region) * Purpose) plotly_key_tree(shared_tourism) }
if (interactive()) { shared_tourism <- as_shared_tsibble(tourism_monthly, spec = (State / Region) * Purpose) plotly_key_tree(shared_tourism) }
Yearly mean total sunspot number (1700 - 2019)
sunspots2019
sunspots2019
An object of class tbl_ts
(inherits from tbl_df
, tbl
, data.frame
) with 320 rows and 2 columns.
WDC-SILSO, Royal Observatory of Belgium, Brussels
data(sunspots2019)
data(sunspots2019)
A dataset containing the monthly overnight trips from 1998 Jan to 2019 Dec across Australia.
tourism_monthly
tourism_monthly
A tsibble with 80,696 rows and 5 variables:
Month: Year month (index)
State: States and territories of Australia
Region: The tourism regions are formed through the aggregation of Statistical Local Areas (SLAs) which are defined by the various State and Territory tourism authorities according to their research and marketing needs
Purpose: Stopover purpose of visit:
"Holiday"
"Visiting friends and relatives"
"Business"
"Other reason"
Trips: Overnight trips in thousands
data(tourism_monthly)
data(tourism_monthly)
A pair of UI and server functions: tsibbleWrapUI()
and tsibbleWrapServer()
.
tsibbleWrapUI(id) tsibbleWrapServer(id, plot, period)
tsibbleWrapUI(id) tsibbleWrapServer(id, plot, period)
id |
A unique shiny id. |
plot |
A |
period |
A string passed to |
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) }
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) }