shiny-reactivity

Update two sets of radiobuttons reactively - shiny

坚强是说给别人听的谎言 提交于 2019-12-12 03:54:52
问题 I have read this (How do I make the choices in radioButtons reactive in Shiny?) which shows me how to update radioButton s in a reactive way. However, when I try and update two sets of buttons from the same data, only one set renders. Example: Server: # Create example data Wafer <- rep(c(1:3), each=3) Length <- c(1,1,2,1,1,1,3,5,1) Width <- c(3,1,6,1,1,1,1,1,6) dd <- data.frame(Wafer, Length, Width) shinyServer(function(input, output, session){ # Create reactive dataframe to store data values

Passing multiple selections from selectizeInput to MySQL query

天涯浪子 提交于 2019-12-11 19:14:13
问题 I am trying to pass multiple values of a selectizeInput to a MySQL query. The question is what is the right syntax for this kind of operation in a shiny app ? What I tried and is working with one value library(shiny) library(DBI) library(RMySQL) server <- shinyServer(function(input, output, session) { con <- dbConnect(MySQL(), user='user', port = 3306, password='pwd', dbname='db', host='host' ) on.exit(dbDisconnect(con), add = TRUE) output$textview <- renderUI({ con <- dbConnect(MySQL(), user

How to display Year to Date data in ShinyDashboard R?

我是研究僧i 提交于 2019-12-11 16:23:06
问题 Below is the dataset. This dataset is about instrument usage at specific location in specific year. currently below code is displaying the results according to the selected option from SideBar Panel i.e when user selects "Loc1" and Year "2018", it will filter and display the data in the mainpanel in the form of Chart as well as table. Next, I would like to display YTD(Year-to-Date) results in the mainpanel when latest year is selected. In this case when user selects Loc1 and Year 2019, the

Save inputs from multiple users in www app folder so that it is always updated when a new session starts in shiny?

六眼飞鱼酱① 提交于 2019-12-11 15:48:54
问题 Multiple users will update a data.frame using multiple inputs in a shiny app. I'd like to be able to save every new submission (or delete actions) in the www directory of my shiny app so that the data.frame is always updated every time a user starts a new session. What would be the best way to do this? App code provided below library(shiny) library(tidyverse) library(shinyWidgets) # Define the fields we want to save from the form fields <- c("q1", "q2", "q3", "q4", "q5", "q6") # Save a

SelectizeInput does not display all choices on shiny.io

安稳与你 提交于 2019-12-11 14:58:19
问题 I have a shiny app that has a selectizeInput widget which gets its about 26000 choices from a remote database in form of reactive data. The use of a remote database and reactivity is to avoid lagging and slowness when loading the choices. The issue is that when launched on the desktop locally, it works fine but when uploaded on shinyapps.io the widget does not present to the user all available choices. I have played around with the widgets attributes to no avail, for example, setting SERVER

Shiny: observe change in global variable

你说的曾经没有我的故事 提交于 2019-12-11 14:18:45
问题 I am making a very simple game in Shiny. Basically every player plays in their own session, but they share 1 global variable to keep track of the scores of each player. I think I'm succeeding having sessions update the global 'scores' variable, but for some (probably dumb) reason I cannot get the global variable to act as a reactive value (i.e. automatically triggering updateActionButton). Minimal code below: working example: score <- c(100) ui <- fluidPage( titlePanel("Hello Shiny!"),

Error: cannot coerce class “c(”reactiveExpr“, ”reactive“)” to a data.frame

放肆的年华 提交于 2019-12-11 05:56:33
问题 I'm new to R, Shiny, and coding in general and have a question. I've been reading through similar questions and cannot get my Shiny app to function based on the answers. Basically, I want the user to be able to enter in numeric inputs, put those inputs into a data frame, and then output plots. Here is the relevant part of my code for the UI: ui <- fluidPage( titlePanel("IQ Plots"), sidebarLayout( sidebarPanel( numericInput(inputId = "FSIQ", label = "FSIQ", min = 40, max = 160, value = 100),

Prevent an event happened in Shiny if no UI inputs are available

血红的双手。 提交于 2019-12-11 04:09:14
问题 I would like to know how to prevent an event happened if no UI inputs are available. In the following example, there is an action button called Add UI . The idea is the users can click that button and add a numeric input as many times as they want. They can then input numeric values. When they are ready, they can click the Sum button. The total of these numbers would be the input value for the "Total" numeric input. However, if the users click the Sum button before adding any UIs, the app

Interactivity between multiple sessions of a single running R Shiny app

寵の児 提交于 2019-12-10 16:26:23
问题 I would like to build an R Shiny app that is able to pass information from one running instance to other possible running instances. I have so far found nothing that could help me with this, and I'm hoping to do it right instead of resorting to global variables and/or writing to files etc (I used global variable in my example below, which I know is a bad practice; and I suspect writing to files wouldn't be a good practice either). So for example, suppose I have my App.R running on a server

How to reactively change title of ShinyDashboard box in R?

旧时模样 提交于 2019-12-10 12:21:50
问题 My code looks like below where user can select location from sidebarpanel and based on user selection data is displayed in mainpanel . Next, I would like to dynamically change the title of the plot based on user selection. For example, If user selects location1 then the tile of Plot should display "Loc1"(Below image highlights the place where, I need to change my title) .I am not sure how to achieve this in ShinyDashboard Please provide explanation with code. Code: library(shiny) library