inst/app/server.R

shinyServer(function(input, output, session) {
  enc <- getOption("radiant.encoding", "UTF-8")

  ## source shared functions
  source("init.R", encoding = enc, local = TRUE)
  source("radiant.R", encoding = enc, local = TRUE)

  ## packages to use for example data
  options(radiant.example.data = "radiant.data")

  ## source data & analysis tools
  for (file in list.files(c("tools/app", "tools/data"), pattern = "\\.(r|R)$", full.names = TRUE)) {
    source(file, encoding = enc, local = TRUE)
  }

  # dataviewer_proxy <- DT::dataTableProxy("dataviewer", session)

  # observe(session$setCurrentTheme(
  #   if (isTRUE(input$dark_mode)) {
  #     bslib::bs_theme(version = 4, bg = "black", fg = "white")
  #   } else {
  #     bslib::bs_theme(version = 4)
  #   }
  # ))

  ## save state on refresh or browser close
  saveStateOnRefresh(session)
})

Try the radiant.data package in your browser

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

radiant.data documentation built on Oct. 16, 2023, 9:07 a.m.