Shiny

Add to a list in Shiny

。_饼干妹妹 提交于 2020-01-01 03:15:07
问题 I want to define a list that a user may update through doing certain actions. I did this: runApp(list( ui=fluidPage( h1('Example') ,textInput('txt','','Text') ,actionButton('add','add') ,verbatimTextOutput('list') )#ui ,server=function(input,output,session) { s.list<-reactive(isolate(d.list())) d.list<-reactive({if (input$add == 0) return() isolate({ list(input$txt,unlist(s.list())) })#iso })#rea output$list<-renderPrint({ list(unlist(d.list())) })#list }#server ))#ruanApp But the list

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')),

Interactive / Reactive change of min / max values of sliderInput

邮差的信 提交于 2019-12-31 22:25:23
问题 I've found some information about how to change the value of a sliderInput with a reactive expression within the siderbarPanel . But instead of the value , I'd like to change min and max of the slider with a numericInput . In this script for server.R it says that only label and value can be changed for sliders. Is there any other possibility to change the min/max values of sliderInput with a reactive expression? Here's an exmple: ui.R: shinyUI(pageWithSidebar( #Sidebar with controls to select

R Shiny: Download existing file

蓝咒 提交于 2019-12-31 08:44:08
问题 Let's say I have an existing zip file ( out.zip ) in my shiny app (i.e. located on a server). I would like to have the user be able to download this file. This question is very similar to this one. However, that question zips files within the downloadHandler whereas the zip file already exists in my case. library(shiny) app <- list( ui = fluidPage( titlePanel(""), sidebarLayout( sidebarPanel( downloadButton("downloadData", label = "Download") ), mainPanel(h6("Sample download", align = "center

How to prevent ggplot hoverOpts messages to go off screen with css

心已入冬 提交于 2019-12-31 05:27:12
问题 When running the demo App below, the problem I run into is that hover messages for the bottom part of the plot end up running off the screen. Does anybody know if there is a way to adjust the position so that the entire message always falls within the screen boundaries (l,r,t,b)? require('shiny') require('ggplot2') library(DT) ui <- pageWithSidebar( headerPanel("Hover off the page"), sidebarPanel(width = 2 ), mainPanel( tags$head( tags$style(' #my_tooltip { position: absolute; pointer-events

Shiny - populate static HTML table with filtered data based on input

别等时光非礼了梦想. 提交于 2019-12-31 04:15:09
问题 I am currently working on a Shiny app which displays a static HTML table, sourced from another file, because of the size of the HTML code. The table is initialized with an empty data table in order to render the empty table. Above the HTML table are normal selectizeInput fields which filter a data table in the background (via a observe() function). The HTML table should then be populated with the filtered data table. I am stuck at the process of updating the HTML table with the "new" data

ggvis output not appearing in shiny application

有些话、适合烂在心里 提交于 2019-12-31 03:53:27
问题 I'm at a loss for what is wrong here, and the other threads on Stack in which users discuss their ggvis + shiny woes don't seem to apply, in spite of being very similar. First, the basic problem is that my ggvis visualization does not appear in the Shiny app. I have another tab in my Shiny app that shows a data table, and that works fine. Also, when I swap out ggvis and use ggplot2 (leaving the rest of the code intact except for using changing to a compatible function in ui.R that calls the

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

Disaggregate in the context of a time series

天大地大妈咪最大 提交于 2019-12-31 03:19:10
问题 I have a dataset that I want to visualize overall and disaggregated by a few different variables. I created a flexdashboard with a toy shiny app to select the type of disaggregation, and working code to plot the correct subset. My approach is repetitive, which is a hint to me that I'm missing out on a better way to do this. The piece that's tripping me up is the need to count by date and expand the matrix. I'm not sure how get group counts by week in one pipe. I do it in several steps and

Using Shiny input variable within dplyr chain

我们两清 提交于 2019-12-31 03:06:11
问题 My input radio buttons allow for several features that the user can filter on, including "Voice", "Format", "DeviceType". Here is a data frame with hard coded values using the "Voice" option that allows my Shiny app to run when used: combinations <- reactive({ expand.grid(unique(combined_data$date), unique(combined_data$Voice)) %>% rename_("date" = "Var1", "Voice" = "Var2") %>% mutate_("Voice" = as.character("Voice")) }) I'm trying to transform combinations to use the input variable: