Shiny

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

Retrieve choice name rather than value

北城以北 提交于 2019-12-30 04:42:06
问题 I have a named choices slot in selectInput , and would like to retrieve the name associated with the choice, rather than the value. MWE: shinyApp( ui = fluidPage( sidebarPanel( selectInput("foo", label = "Select choice here:", choices = c("Choice 1" = "Choice1", "Choice 2" = "Choice2", "Choice 3" = "Choice3"), selected = "Choice1", multiple = TRUE), textOutput("nameOfChoice") ), mainPanel()), server = function(input, output) { output$nameOfChoice = renderText(input$foo[1]) } ) Which produces:

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,

R Shiny display full dataframe without filter input until filterinputs are changed

寵の児 提交于 2019-12-29 09:22:29
问题 I am trying to build an app which displays a dataframe as a datatable. I wanted to provide users with ability to subset the datatable with selectinput and daterangeinput filters on the sidebar panel. Heres when I ran into issues, it only subsets the datatable when all the inputs are selected it displays an empty datatable on loading the app when one of the inputs are changed back it doesnot update the datatable. Here is my sample code for shiny app Region <- c("USA","UK","JPN","JPN","UK","USA

Shiny: How to stop processing invalidateLater() after data was abtained or at the given time

假如想象 提交于 2019-12-29 08:24:09
问题 I want to keep reflashing until 10:05, after 10:05 I got the tplus0_dt and stop to processing invalidaterLater(). Before 10:00, tplus0_dt doesn't exist, so I need to keep reflashing until 10:05. After 10:05, it is no need to refalsh, and when the tplus0_dt becomes very lage the invalidaterLater() will effects the displaying of table1, the screen and plots go GRAY every 1 seconds so it looks like the page is dead while the updating occurs. So how can I do to stop processing the invalidateLater

Shiny: unwanted space added by plotOutput() and/or renderPlot()

丶灬走出姿态 提交于 2019-12-29 07:53:06
问题 Either plotOutput or renderPlot seems to add a bunch of extra white space around a plot. I've added background colours to the plot and the layout column to illustrate this. Essentially, I would like to be completely rid of this white space, leaving only the area coloured in blue , which should then align itself to the left of the column. I know that this can be adjusted using the width argument, but having it a either 100% or auto doesn't seem to work properly. Thanks! library(shiny) library

Packages missing in shiny-server

ε祈祈猫儿з 提交于 2019-12-29 07:11:47
问题 I am trying to create a web application using shiny. It requires me to load a package I have installed on my computer. For example: ## Contents ui.R: library(shiny) library(plyr) shinyUI(pageWithSidebar( headerPanel("Hello Shiny!"), sidebarPanel( sliderInput("obs", "Number of observations:", min = 0, max = 1000, value = 500) ), mainPanel( plotOutput("distPlot") ) )) ## Contents server.R: library(shiny) library(plyr) shinyServer(function(input, output) { output$distPlot <- renderPlot({ #

Tiny plot output from sankeyNetwork (NetworkD3) in Firefox

ぐ巨炮叔叔 提交于 2019-12-29 07:01:48
问题 As per object, I get a very small plot in Firefox when using sankeyNetwork() from networkd3 in shiny but not in Chrome or RStudio. I have not included any CSS or JS in the script - the code below produces this result for me. Is there any CSS property I have missed? I am using R 3.4.1, shiny 1.1.0, networkD3 0.4 and Firefox 52.9.0. Firefox: Chrome: library(shiny) library(magrittr) library(shinydashboard) library(networkD3) labels = as.character(1:9) ui <- tagList( dashboardPage(

Using image in r markdown report downloaded from Shiny app

心已入冬 提交于 2019-12-29 06:28:30
问题 I have created a very large shiny app that has a downloadable pdf report. The client has requested their logo in the header of every page of the pdf. I can get a logo on the pdf when the pdf is by itself (not part of the larger shiny app) but pandoc cannot find the image when I try to download the exact same report from within the shiny app. Below is a minimum working example and a list of things I have tried and failed to get to work. smiley.png is in the folder with app.R and can be

R shiny color dataframe

霸气de小男生 提交于 2019-12-29 04:41:05
问题 I have a data frame: runApp( list(ui = bootstrapPage(pageWithSidebar( headerPanel("Data frame with colors"), sidebarPanel(), mainPanel( tableOutput("my_dataframe") ) ) ) , server = function(input, output) { output$my_dataframe <- renderTable({ data.frame("Brand ID"=1:4,"Client1"=c("red", "green", "green", "green"), "Client2"=c("green", "red", "green", "red")) }) } ) ) Is it possible to color data frame like: For example, when I have contidion1 I need to color data frame cell with red, on