The goal of shinymods is to package some convenient Shiny (Chang et al. 2021) modules that are often used to build an app. Some of the modules are inspired by the book Mastering Shiny (Wickham 2020).
You can also vendor the source R code to your own project to prevent having excessive dependencies.
This R (R Core Team 2022) package is intended to help you construct Shiny (Chang et al. 2021) applications. Some of the modules are derived from examples in the book Mastering Shiny: Build Interactive Apps, Reports, and Dashboards Powered by R by Wickham (2020).
You can install the development version of shinymods from GitHub with:
# install.packages("devtools")
devtools::install_github("MartinSchobben/shinymods")
This is a basic example of a shiny app that requires filtering based on
the variables in a dataframe
, where the controllers are conditional to
the value ranges of that particular variable.
library(shiny)
library(shinymods)
## basic example code
ui <- fluidPage(
sidebarLayout(
sidebarPanel(
dataset_ui("test", filter = is.data.frame),
filter_ui("test")
),
mainPanel(
tableOutput("table")
)
)
)
server <- function(input, output, session) {
dt <- dataset_server("test")
ft <- filter_server(dt, "test", shinyjs = FALSE)
output$table <- renderTable({req(ft()); ft()})
}
shinyApp(ui, server)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.