inst/demo_app/www/script/init.md

Initialization

pivot_cols and indicator_cols can be used to restrict possible column choices.

It's also possible to fully initialize the first pivot table with the argument initialization, a named list with :

Code

initialization <- list(
  "rows" = c("TOC", "Status"),
  "cols" = "TrainCategory",
  "target" = NULL,
  "idc" = NULL,
  "combine_target" = NULL,
  "combine_idc" = NULL,
  "combine" = NULL,
  "idcs" = c(
    list(
      # simple
      c("label" = "status", "target" = "ServiceId", "idc" = "Count")
    )
  )
)

# ui
ui = shiny::fluidPage(
  shinypivottablerUI(id = "id", 
    app_colors = c("#e6e6e6", "#430838"),
    app_linewidth = 3
  )
)

# server
server = function(input, output, session) {
  shiny::callModule(module = shinypivottabler,
                    id = "id",
                    show_title = FALSE,
                    initialization = initialization,
                    data = data)
}


Try the shinypivottabler package in your browser

Any scripts or data that you put into this service are public.

shinypivottabler documentation built on Jan. 6, 2023, 5:25 p.m.