Relative Content

Tag Archive for rshinymodule

What is current best practice for R Shiny namespace modules?

I’m wrestling with the best template to use going forward for my namespace modules in R Shiny. I show two sets of code below that do the exact same thing using namespace modules, Example 1 and Example 2. They use different structures. They both simply add a value of 10 to the slider input values for the sake of easy example. Example 1 is one alternative that someone pointed me to. Example 2 is the method that I’ve been using, and I find it easier to visualize than Example 1, but I was told it is an outdated form of module.

How to cleanly inject a namespace module’s UI into a main app’s UI, using R Shiny?

I have two R Shiny example files that use sidebarPanel() and mainPanel(). One file, shown below, is called “Main App”, and the other, also shown below, is called “Mod1”. I would like to make the Mod1 a namespace module used by Main App to add to its respective sidebarPanel() and its mainPanel(). I would like to do this while maintaining the sidebarPanel() and mainPanel() of Mod1 so I can test and build that module separately from the Main App. Note for sake of simplicity the 2 examples are drafted where there is no data sharing between them although that will come later if I can figure out this first step.

Filtering data frame based on input created with a dependent renderUI with shiny modules

I am currently trying to make an application that takes in a large data frame and then filters based on a column from the uploaded data frame, before displaying a table for the user. When I try to filter based on the value of the dependent input, I receive an error that the filter value must be ‘[size of the data frame] or 1, not size 0’. I can render the output of the value, just not filter with it.