shinydashboard

R shinydashboard - show/hide multiple menuItems based on user input

筅森魡賤 提交于 2019-12-04 21:57:10
The idea is to have a user input (access code), based on which different menuItems can be accessed. So basically we have a custom version of app available based on user's requirement. A working example for 3 menuItems is as follow: library(shiny) library(shinydashboard) library(shinyjs) ui <- dashboardPage( dashboardHeader(title = "SHOW/HIDE MULTIPLE MENU ITEMS"), dashboardSidebar( useShinyjs(), sidebarMenu( id = "tabs", hidden( menuItem("MENU ITEM 1", tabName = "mi1"), menuItem("MENU ITEM 2", tabName = "mi2"), menuItem("MENU ITEM 3", tabName = "mi3") ), textInput(inputId = "accessToken",

How to Add edit delete of table in shiny app

孤街醉人 提交于 2019-12-04 21:07:50
I want to CRUD(Create, read,update and delete) in a table in shiny app. it update and delete perfectly but when I want to add new record it does not show the input from slider when the textinput is filled. Sometimes it only shows the default of sliderInput which is 2 when the value of name is NULL. ui <- fluidPage( #use shiny js to disable the ID field shinyjs::useShinyjs(), #DT::dataTableOutput("responses"), shinyjs::disabled(textInput("id", "Id", "0")), textInput("name", "Name", ""), checkboxInput("used_shiny", "I've built a Shiny app in R before", FALSE), sliderInput("r_num_years", "Number

Is there a way to deploy R shiny apps as web page using windows server?

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-04 20:02:10
Let me know if there is a way to deploy shiny dashboards as a webpage using windows server. I know it is possible using Linux but it need it for windows. If you put below code as last lines: app <- shinyApp(ui,server) runApp(app,host="0.0.0.0",port=5050) Then to run you Shiny App in any other machine just give the IP of the machine where the code is deployed and the port number which is 5050 in this case. So, for example if you code is deployed on a machine with IP: 123.12.123.12 then for any other machine just write 123.12.123.12:5050 on any web browser. The only caveat is the machine where

R Shinydashboard dynamic menuItem

时间秒杀一切 提交于 2019-12-04 17:22:20
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 from the paste function doesn't resolve( I get the result of paste function on the sidebar). I tried

Align header elements in shiny dashboard

限于喜欢 提交于 2019-12-04 13:53:33
I'm working with shinydashboard to jazz up a shiny app a bit and I'm having trouble positioning some elements (eg logo) on the page. I found this answer which was immensely useful in increasing the height of the header, but I can't quite manage the alignment issue. There are still spaces on the left and right (red ovals) between the logo and the floating hamburger and the edges. The only way I've been able to move the hamburger has been increasing the relative size ( titleWidth = "92%" ) of the header to accommodate the longer title, but if the window is resized, the menu collapse toggle ends

Add coordinates to image for use as map in Leaflet, Shiny and Shinydashboard packages in R

微笑、不失礼 提交于 2019-12-04 09:22:47
I am planning to create an interactive map with markers of hospital OHS incidents using Leaflet, Shiny and Shinydashboard along the lines of the following awesome template for interactive map and histogram My problem is that I do not have a coordinate reference system as this is not a geographic object (no lat and long). Also it is in raster form. How can I make the below floorplan into something with a CRS (coordinate reference system) that can be treated like a map. That is, I want to be able to pan, zoom, add Markers etc. There appears to be a way to do this using Java however I was hoping

How to remove option bar from ggplotly plot?

◇◆丶佛笑我妖孽 提交于 2019-12-04 08:47:49
问题 I have a plot that I am rendering in shiny using plotly and ggplot2 . However, I do not want the option bar that appears on hover to appear. Is there a way to use ggplotly(p) and remove the option bar? 回答1: There is a great answer on community plotly the short version: library(plotly) set.seed(100) d <- diamonds[sample(nrow(diamonds), 1000), ] Using ggplotly : p <- ggplot(d, aes(carat, price)) + geom_point() ggplotly(p) %>% config(displayModeBar = F) If you are not using ggplotly you can do:

R Shiny selectInput that is dependent on another selectInput

淺唱寂寞╮ 提交于 2019-12-04 08:18:57
问题 I have some data below that I'm using to create a donut chart in R shiny, where date is a character. I want to be able to select the email whose score I want to view, but then in the second dropdown selection only see the dates for which that email has activity. For example, if I select email = xxxx in the first dropdown, I want to see only 'no activity' in the date selection field. And for email = yyyy, I want to see only 6/17/14, 6/18/14, 6/19/14 as selections. I've tried a sort of nested

Tab Box CSS for shinydashboard

為{幸葍}努か 提交于 2019-12-04 07:52:26
I'm trying to change the tab style for tabBox in shinydashboard . I was able to change the background of the tabs that aren't selected, but I can't change the background of the tab that is selected or the text that appears in each tab. This is what I added to a custom.css file to change the unselected tab backgrounds: .nav-tabs { background-color: #006747; } I tried stuff like .nav-tabs .active but I couldn't get anything to work. Also if anybody knows how to change the small colored sliver that appears next to your selected tab, that would be appreciated also. Developper tools and "inspect

How to change the fonts size of sidebar in shinydashboard

女生的网名这么多〃 提交于 2019-12-04 05:43:20
问题 I am new to shiny dashboard and don't familiar with CSS, can anyone tell me how to change the fonts size of sidebar in shinydashboard? Many thanks, below is my code. library('shinydashboard') library(shiny) ui <- dashboardPage( dashboardHeader(title = 'Test'), dashboardSidebar( sidebarMenu( menuItem('Tab1', tabName = '1', icon = icon('dashboard')), menuItem('Tab2', tabName = '2', icon = icon('th')) )), dashboardBody(tabItems( #First tab content tabItem(tabName = '1', fluidRow( box(plotOutput(