shinydashboard

How to create a conditional renderUI in Shiny dashboard

纵然是瞬间 提交于 2019-12-08 12:20:47
问题 I am unable to create a conditional sidebar menu via renderMenu because the if statement fails. "Warning: Error in if: argument is of length zero". I found conditional RenderUI R shiny and Conditional panel in Shiny dashboard but neither are what I am looking for. A conditional panel might work in this instance but in the long run I will need to be able to do this server side. if (interactive()) { library(ggplot2) library(shiny) library(shinydashboard) library(shinipsum) ui <- dashboardPage(

Shinyjs: On click option in shiny dashboard

人走茶凉 提交于 2019-12-08 12:04:03
问题 I have a shiny dashboard app with 3 tabs and a notification menu. I am trying to track user activity on the dashboard and wish to log each of their clicks on the dashboard. The code in server.R for the tabset panel is as below: output$tabs1=renderUI( tabsetPanel(type="tab", tabPanel(id="OverallTab","Overall Activity"), tabPanel(id="Tab1","Tab 1 details"), tabPanel(id="Tab2","Tab 2 details")) Part of my notification code is as below: output$notiMenu <- renderMenu({ all_nots <- apply(u_notd, 1,

error running shiny app “can not open connection”

别说谁变了你拦得住时间么 提交于 2019-12-08 11:56:11
问题 I am trying to load the data from .RData file on my computer and I am trying to run a shiny application for that. My code is below, but when I run it I get error "Can not open connection".. Why this error? library(shiny) ui <- fluidPage( tableOutput("table") ) server <- function(input, output, session) { dataset <- reactive({ if (inFile == "") return(NULL) get(inFile$file1, load("E:/RProjects/Dashboard/gender1.RData")) }) output$table <- renderTable({ if (is.null(dataset())) return(NULL) head

Icon in shiny/ shinydashboard

假装没事ソ 提交于 2019-12-08 11:37:21
问题 My client wants me to create a shinydashboard that contains this icon: Does anyone know of a similar icon or anything in shiny / shinydashboard that allows me to put a number in the middle of a circle??? 回答1: If it is just about the icons, you will find it here: https://fontawesome.com/icons/circle?style=regular But if you want to show a number inside, you could do that with plain css. library(shiny) ui <- fluidPage( titlePanel("Circle"), sidebarLayout( sidebarPanel( includeCSS("www/style.css

Creating a SQL query using selectinput in R shiny

半世苍凉 提交于 2019-12-08 08:53:57
问题 I am trying to create a dynamic query using select input. Something like Select * from basket where fruits in("apple","banana","cherry") I have a table called fruit_list which populates my selectinput box. selectInput("fruit_list", label = h5("Select fruit"), multiple = T, choices = (dbGetQuery(conn, "SELECT fruit from fruit_list');"))) So far, when i renderprint my selection I get "apple" "banana" "cherry" I need a comma between the elements to get "apple","banana","cherry" When i choose a

Use.js to set the height of highcharter plot and shinydashboard box

喜夏-厌秋 提交于 2019-12-08 08:12:41
问题 I have a shiny app in which I try to set the the height of the highcharter plot and the box that includes it with the same .js code. But it does not seem to respond. library(shiny) library(shinydashboard) library(shinydashboardPlus) library(highcharter) jscode <- '$(document).on("shiny:connected", function(e) { var jsHeight = 0.65 * document.body.clientWidth; Shiny.onInputChange("GetScreenHeight", jsHeight); }); ' shinyApp( ui = dashboardPagePlus( header = dashboardHeaderPlus( ), sidebar =

Shiny App-showModal does not pop up with renderSankeyNetwork

青春壹個敷衍的年華 提交于 2019-12-08 07:50:50
问题 I am developing a Shiny application which has two components Sankey Diagram and one action button which pop up "SaveMsg" dialog box on click of button . I am seeing unexpected behavior where, If I user actionbutton and Sankeyvisualization in one dashboard, on click of action button, dashboard screen greyed out. however If I comment Sankey code and keep only Action button on UI, Action button works as expected by showing pop up message of "save successfull". If I comment action button code and

Hide main header toggle in R Shiny App

吃可爱长大的小学妹 提交于 2019-12-08 06:36:15
问题 I am looking for a way to hide main header toggle icon as we do for side bar in R Shiny App using ShinyJS Package. Attaching the Image for the reference. Code library(shiny) library(shinydashboard) library(shinyjs) ui <- shinyUI(dashboardPage( dashboardHeader(), dashboardSidebar(), dashboardBody( useShinyjs() ) )) server <- shinyServer(function(input, output, session) { addClass(selector = "body", class = "sidebar-collapse") # Hide Side Bar }) shinyApp(ui = ui, server = server) 回答1: One way

Show/hide menuItem in shinydashboard

拟墨画扇 提交于 2019-12-08 05:06:16
问题 I need a menuItem hidden, when the app is entered into. When a user chooses a certain value, the menuItem has to appear. I have tried shinyjs functions hidden , and it hides a menuItem, but when using show or toggle , a menuItem doesn't appear. I've found R shinydashboard - show/hide multiple menuItems based on user input and came up with this library(shiny) library(shinydashboard) library(shinyjs) header <- dashboardHeader(title = "APP", titleWidth = 330) sidebar <- dashboardSidebar(

How to see if a shiny dashboard box is collapsed from the server side

谁都会走 提交于 2019-12-08 05:00:59
问题 I'm trying to find a way to check whether a Shiny Dashboard Box is collapsed or expanded. By reading the great reply by @daattali in How to manually collapse a box in shiny dashboard I know it is possible to collapse the box from the server side by using the shinyjs package, as illustrated in the code below library(shiny) library(shinydashboard) library(shinyjs) jscode <- " shinyjs.collapse = function(boxid) { $('#' + boxid).closest('.box').find('[data-widget=collapse]').click(); } " ui <-