shinydashboard

How to manage my R code in a shiny or shinydashboard app?

你。 提交于 2020-01-02 08:49:23
问题 I have made a shinydashboard app which has now quite an amount of lines of code, and I am wondering if there are ways to split the code into different . R files. I have seen a similar question here, but the answer does not help (especially it says nothing about the code in the server part of the app). For the ui part, I have created functions called header , sidebar , and body , and then I merely write ui <- dashboardPage(header(), sidebar(), body()) It works well, and it still works if the

R Shinydashboard dynamic menuItem

对着背影说爱祢 提交于 2020-01-01 17:24:22
问题 I'm trying to generate multiple menuItem s dynamically, may be simple, but I'm not getting the right idea. library(shiny) library(shinydashboard) port_tables<-c("tab1","tab2","tab3","tab4") # These are from a DB connection in the original code function(input, output) { output$smenu1 <- renderMenu({ sidebarMenu( id = "tabs", h4("Tables",style="color:yellow;margin-left:20px;"), paste("menuItem(\"",port_tables,"\",tabName=\"",port_tables,"\",icon=icon('th'))",collapse=",") ) }) ) The menuItems

Dynamically colored sliderInput

≯℡__Kan透↙ 提交于 2020-01-01 14:27:21
问题 I have a question that is related to post How to color sliderbar (sliderInput)?. Is it possible to make the sliderInput change its color dependent on the chosen value? I would like to offer the user to input a value from 0 to 10. However, there is a recommended range from, say, 4 to 8. As a consequence, the slider color should be green if the user chooses a value between 4 and 8, but it should change to orange (or red) if a value outside the recommended range is chosen. Any help on

Dynamically colored sliderInput

我们两清 提交于 2020-01-01 14:24:03
问题 I have a question that is related to post How to color sliderbar (sliderInput)?. Is it possible to make the sliderInput change its color dependent on the chosen value? I would like to offer the user to input a value from 0 to 10. However, there is a recommended range from, say, 4 to 8. As a consequence, the slider color should be green if the user chooses a value between 4 and 8, but it should change to orange (or red) if a value outside the recommended range is chosen. Any help on

Shinydashboard: Is it not possible to have nested menu sub items? Can't make it work

只谈情不闲聊 提交于 2020-01-01 02:29:10
问题 I am using a shinydashboard, and have a need to build two-level nested sub menus. I am trying this and won't work: library(shinydashboard) sidebar <- dashboardSidebar( sidebarMenu(id = 'sidebarmenu', menuItem('x', tabName = 'x', icon = icon('line-chart')), menuItem('y', tabName = 'y', icon = icon('line-chart'), menuSubItem('a', tabName = 'a', icon = icon('line-chart')), menuSubItem('b', tabName = 'b', icon = icon('line-chart'), menuSubItem('l', tabName = 'l', icon = icon('line-chart')),

How to Create a Choropleth or Bubble Map of UK in R [closed]

怎甘沉沦 提交于 2019-12-31 07:41:42
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 2 years ago . I have been trying to build a Choropleth / Bubble map of UK for my own shiny dashboard project. My dashboard is a student information management system and the map is supposed to show students come from which regions (zip codes or cities is also fine). Unfortunately, most packages

Disable browsers back button in R shiny App

亡梦爱人 提交于 2019-12-31 03:48:11
问题 I am building a shiny app which has a lot of conditional panel. I have a back button in the app itself to navigate between the conditional panel. I would like to disable the web browsers back button as clicking that button goes to previous webpage(away from my app). Is there a way to do this? 回答1: You can write some javascript to do this. Here I have two examples, note that I only tested this on Chrome Example 1 will return a message upon activation of the back button within the browser rm

r shiny - uiOutput not rendering inside menuItem

北城以北 提交于 2019-12-31 02:55:26
问题 Question Why does a sliderInput() that's generated on the server , and rendered on the ui with uiOutput() not get displayed in a menuItem() ? Example In this simple app I'm generating a sliderInput on the server (note the menuItem is deliberately commented out), and it works as expected library(shiny) library(shinydashboard) rm(ui, server) ui <- dashboardPage( dashboardHeader(), dashboardSidebar( sidebarMenu( #menuItem(text = "data options", checkboxGroupInput(inputId = "cbg_group1", label =

Add dynamic tabs in shiny dashboard using conditional panel

隐身守侯 提交于 2019-12-30 04:57:08
问题 I would like to have dynamic tabs for my shiny app. I tried the below code ## app.R ## library(shiny) library(shinydashboard) ui <- dashboardPage( dashboardHeader(), dashboardSidebar( checkboxGroupInput("Tabs", label = h4("tabpanel"), choices = list("tabs" = "tabs"), selected = NULL), checkboxGroupInput("moreTabs", label = h4("moretabpanel"), choices = list("moretabs" = "moretabs"), selected = NULL) ), dashboardBody( conditionalPanel( condition = "input.Tabs == 'tabs'", tabBox( title = "intro

Hide sidebar in default in shinydashboard

て烟熏妆下的殇ゞ 提交于 2019-12-30 04:36:24
问题 I used shinydashboard to create my app. I would like to hide the sidedar in default on desktop environment (e.g. windows), but not to disable it. On the mobile device, the sidebar is hide in default. I think I need to change the css class, but don't know how to do it. Thanks for any suggestions. This is my playing codes: library(shiny) library(shinydashboard) ui <- shinyUI(dashboardPage( dashboardHeader(), dashboardSidebar(), dashboardBody() )) server <- shinyServer(function(input, output,