This package provides some useful shiny modules to build quickly an ergonomic tool to explore a table.
You can install:
- the latest development version from GitHub with :
devtools::install_github("datastorm-open/shinymodules")
online
https://datastorm-demo.shinyapps.io/shinymodules/
local
if(!require(nycflights13)) install.packages("nycflights13")
if(!require(data.table)) install.packages("data.table")
if(!require(esquisse)) install.packages("esquisse")
if(!require(colourpicker)) install.packages("colourpicker")
runApp(system.file("demo_app", package = "shinymodules"))
filter_data
is a module used to filter a given data.table on chosen columns by the user. The server part returns a reactive value containing the filtered data.table.
?shinymodules::filter_data
# ui.R
shinymodules::filter_data_UI(id = "filter_id"))
# server.R
full_data <- reactive({...})
output_filter <- shiny::callModule(module = shinymodules::filter_data,
id = "filter_id",
data = full_data,
columns_to_filter = "all")
# then, have fun with filter data !
your_filtered_table <- output_filter$data
Display an automatically generate dashboard that shows descriptive statistics with shinymodules::summary_data
: for every columns from the table you selected. The statistics chosen depend on the column's type (character, factor, numeric, date).
?shinymodules::summary_data
# ui.R
shinymodules::summary_data_UI(id = "stat_desc_id", titles = FALSE)
# server.R
data <- shiny::reactive({my_data})
shiny::callModule(module = shinymodules::summary_data,
id = "stat_desc_id",
data = shiny::reactive(data),
optional_stats = "all",
nb_modal2show = 6,
labels = list(title = "Descriptive statistics",
num_var = "Variables numériques",
date_var = "Variables dates",
factor_var = "Variables facteurs",
message = "Calcul des indicateurs en cours..."))
Show & export table using DT package
?shinymodules::show_DT
# ui.R
shinymodules::show_DT_UI(
id = "iris_module",
export = c("csv", "html")
)
# server.R
shiny::callModule(module = show_DT,
id = "iris_module",
data = reactive(iris),
dt = reactive(DT::datatable(iris)),
file_name = paste0("Iris_export", format(Sys.time(), format = "%d%m%Y_%H%M%S"))
)
This module provides tools to monitor models. (Only quantitative regression at moment)
## UI
shinymodules::monitoring_data_UI("my_id")
## SERVER
shiny::callModule(shinymodules::monitoring_data, "my_id", data = reactive(data),
col_obs = col_obs,
col_fit = col_fit,
col_date = col_date,
indicators = indicators)