slice_tsbl: Slice tibble of time series by user inputs

Description Usage Arguments Details Value Functions Examples

Description

A shiny module to slice tibble of time series(tsibble) by user's filter. conditions.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
slice_tsbl_ui(id, debug = FALSE)

slice_tsbl_server(
  id,
  tsbl_vars,
  slice_type = c("cross_section", "time_series"),
  debug = FALSE
)

slice_tsbl_app(
  use_online_data = FALSE,
  slice_type = c("cross_section", "time_series"),
  debug = on_debug()
)

Arguments

id

An ID string of module to connecting UI function and Server function.

debug

A logic to enable debug or not, default is on_debug() which returns DEBUG environment variable.

tsbl_vars

A tsibble of time series to be sliced.

slice_type

A character indicator about how to slice data, e.g., "cross_section", "time_series". Default is cross_section.

use_online_data

A logical to determine whether to use test data from database or not. Default FALSE means to use achieved data for tests.

Details

The module is an UI for user to choose some conditions for slice(filter) tibble of time series.

User will promote to use following filter conditions to filter:

Value

Functions

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
## Not run: 
# Set up control UI in app UI
ui <- fluidPage(
  slice_tsbl_ui("slice_tsbl_module")
)

# Call control server in App server
server <- function(input, output, session) {

  # Slice tsibble of variables by timeseries and show result in debug mode
  slice_result <- slice_tsbl_server("slice_tsbl_module",
    tsbl_vars = reactive(tsbl_vars),
    slice_type = "time_series",
    debug = TRUE
    )

 # A tsibble of variables sliced by user
 slice_tsbl_vars <- slice_result$slice_vars

 # A tsibble of industry average of variables sliced by user
 slice_vars_average <-  slice_result$slice_vars_average
}

# Run testing App for integration testing
slice_tsbl_app( use_online_data = FALSE,
                slice_type = "time_series",

## End(Not run)

chriszheng2016/zstexplorer documentation built on June 13, 2021, 9:47 a.m.