Shiny

R Shiny: How can I make multiple elements reactive in add/remove button context?

孤者浪人 提交于 2021-02-08 15:18:01
问题 I am creating a shiny app such that when I click on add or remove button, multiple reactive elements are affected. I have simplified significantly what I am trying to do below. Basically, we get selectInput() and textInput() boxes side-by-side, such that the textInput() box is populated with the user-chosen result of selectInput() box. I then have an add button and remove button, such that by clicking the add button, on the next line down, we get new selectInput() and textInput() boxes side

download a plot without replotting in R shiny

蹲街弑〆低调 提交于 2021-02-08 11:38:44
问题 I am trying to download a already plotted ggplot image without replotting it again. All the solutions I found (e.g. Save plots made in a shiny app) calling the function to create the figure again when they download the image. Is there a workaround? My images are very complex and take some time to create. 回答1: Use the ggplot2::last_plot function: library(shiny) library(ggplot2) k <- 0 runApp(list( ui = fluidPage( plotOutput("fooplot"), textOutput("fook"), downloadButton('foo') ), server =

RShiny: How to center sliders

寵の児 提交于 2021-02-08 11:25:27
问题 I am new to RShiny and I am trying to replicate this template: https://shiny.rstudio.com/gallery/retirement-simulation.html I do have the code for this template but this is a learning exercise. Here is what I have so far: ui <- fluidPage( # Title goes here... titlePanel("Retirement: simulating wealth with random returns, inflation and withdrawals"), p("Description here..."), hr(), # Sidebar layout... sidebarLayout( # Sidebar panel... sidebarPanel( # Input: Slider for the number of

setting the zoom level to 7.25 in shiny leaflet r

喜欢而已 提交于 2021-02-08 11:08:39
问题 Using leaflet function within the shiny context, I have been able to create a great interactive map. I would like to set the zoom to somewhere between 7 and 7.5 (e.g., 7.25). I tried to do so as is shown in the code below but the zoom level in the map remained unchanged. It appears that one can set the zoom level to either 7 or 7.5 not anything between these numbers. How can fix this? Thanks. setView(-82.706838, 40.358615, zoom=7.25) 回答1: Use leaflet map options: zoomSnap: how small you can

setting the zoom level to 7.25 in shiny leaflet r

℡╲_俬逩灬. 提交于 2021-02-08 11:07:01
问题 Using leaflet function within the shiny context, I have been able to create a great interactive map. I would like to set the zoom to somewhere between 7 and 7.5 (e.g., 7.25). I tried to do so as is shown in the code below but the zoom level in the map remained unchanged. It appears that one can set the zoom level to either 7 or 7.5 not anything between these numbers. How can fix this? Thanks. setView(-82.706838, 40.358615, zoom=7.25) 回答1: Use leaflet map options: zoomSnap: how small you can

Shiny application successfully deployed but opens to “Error : You must register an account using setAccountInfo prior to proceeding.”

牧云@^-^@ 提交于 2021-02-08 10:40:36
问题 I successfully deployed my first app following the the instructions on http://shiny.rstudio.com/articles/shinyapps.html. I then successfully deployed my second app. I decided to make some changes to my first application. I archived and deleted the application, created a new R file of the app and then tried to deploy it. Everything works well and I see the following message in the "Deploy" window: Application successfully deployed to https://hessamss2.shinyapps.io/icu_infection However, when

How to display scatter plot with R Packages:svgPanZoom?

荒凉一梦 提交于 2021-02-08 10:40:26
问题 I draw a picture using ggplot2 and want to display it in shinyApp with svgPanZoom packages. But the sactters is disappear. Anybody know why? You can run the following code for detail: library(shiny) library(svglite) library(svgPanZoom) library(ggplot2) data<-data.frame(x=1:10,y=1:10) ui <- shinyUI(bootstrapPage( svgPanZoomOutput(outputId = "main_plot") )) server = shinyServer(function(input, output) { output$main_plot <- renderSvgPanZoom({ p <- ggplot(data, aes(x = x, y = y)) + geom_point()

RShiny computation progress indicator

人盡茶涼 提交于 2021-02-08 10:20:11
问题 I made an RShiny app with a lengthy computation. The lengthy computation leaves the screen at a standstill, and I am worried that either the computation came up blank, or that the connection timed out, or something else might have happened. Is there a way to show an indicator (ie rotating hour glass, etc) on the screen to show the user that processing is ongoing. 回答1: You could add a progress bar. http://shiny.rstudio.com/reference/shiny/1.2.0/Progress.html. This might take a bit of

Shiny R using input-variables for dynamic dplyr creation of dataTables

谁都会走 提交于 2021-02-08 09:55:53
问题 Target: Building a shiny-app which enables the user to make 3 inputs via Groupcheckboxfields: Groupingvariables Metricvariables Statistics which are used in dplyr look at this code first - it is executed without shiny and displays the to be achived results: library("plyr") library("dplyr") ## Without shiny - it works! groupss <- c("gear", "carb") statistics <- c("min", "max", "mean") metrics <- c("drat", "hp") grp_cols <- names(mtcars[colnames(mtcars) %in% groupss]) dots <- lapply(grp_cols,

Shiny R using input-variables for dynamic dplyr creation of dataTables

不打扰是莪最后的温柔 提交于 2021-02-08 09:55:52
问题 Target: Building a shiny-app which enables the user to make 3 inputs via Groupcheckboxfields: Groupingvariables Metricvariables Statistics which are used in dplyr look at this code first - it is executed without shiny and displays the to be achived results: library("plyr") library("dplyr") ## Without shiny - it works! groupss <- c("gear", "carb") statistics <- c("min", "max", "mean") metrics <- c("drat", "hp") grp_cols <- names(mtcars[colnames(mtcars) %in% groupss]) dots <- lapply(grp_cols,