Shiny

Use reactivePoll to accumulate data for output

↘锁芯ラ 提交于 2021-02-07 06:13:28
问题 I just noticed reactivePoll() recently - but need a bit of help figuring it out for my use case. I want to accumulate data into a vector, list, or data.frame (doesn't matter), then plot the data, with the UI showing a graph with data accumulating as new data comes in. The problem is I don't see how to add new data to old data without replacing the old data. In this example (https://gist.github.com/sckott/7388855) I only get the initial row in the data.frame, and the newest one, not an

Use of the session parameter in shiny apps

随声附和 提交于 2021-02-07 04:22:13
问题 As described in RStudio reference docs, shiny server functions can optionally include session as a parameter (e.g. function(input, output, session) ). The session object is an environment that can be used to access information and functionality relating to the session. I never use this parameter in my apps and could be missing something. What are the practical uses of the session parameter? 回答1: Here is my attempt for an overview: List of use cases: Customised user interfaces chat room games

Return datapoints selected in a plotly scatterplot

依然范特西╮ 提交于 2021-02-07 04:12:07
问题 I created a plotly scatterplot from a ggplot2 using ggplotly . I would like to obtain a table of the datapoints selected / zoomed into, but I can't find a way to do this. library(ggplot2) library(plotly) p <- ggplotly(plot.rel.kinship) htmlwidgets::saveWidget(as_widget(p), "scatterplot.html") There seems to be a similar unanswered question on the plotly forum: https://community.plot.ly/t/get-datapoints-in-currently-zoomed-view/259 This question also seems to be related: Using Plotly with DT

Return datapoints selected in a plotly scatterplot

家住魔仙堡 提交于 2021-02-07 04:07:59
问题 I created a plotly scatterplot from a ggplot2 using ggplotly . I would like to obtain a table of the datapoints selected / zoomed into, but I can't find a way to do this. library(ggplot2) library(plotly) p <- ggplotly(plot.rel.kinship) htmlwidgets::saveWidget(as_widget(p), "scatterplot.html") There seems to be a similar unanswered question on the plotly forum: https://community.plot.ly/t/get-datapoints-in-currently-zoomed-view/259 This question also seems to be related: Using Plotly with DT

Return datapoints selected in a plotly scatterplot

帅比萌擦擦* 提交于 2021-02-07 04:07:52
问题 I created a plotly scatterplot from a ggplot2 using ggplotly . I would like to obtain a table of the datapoints selected / zoomed into, but I can't find a way to do this. library(ggplot2) library(plotly) p <- ggplotly(plot.rel.kinship) htmlwidgets::saveWidget(as_widget(p), "scatterplot.html") There seems to be a similar unanswered question on the plotly forum: https://community.plot.ly/t/get-datapoints-in-currently-zoomed-view/259 This question also seems to be related: Using Plotly with DT

Dynamically create plots based on number of uploaded files in Shiny

自古美人都是妖i 提交于 2021-02-07 04:06:51
问题 I am trying to develop a shiny app where the user can upload csv files, which are subsequently analyzed by my R script. Therefore, I would like display a dynamic number of plots, based on the number of files that are processed (one plot for each file). I found this question extremly helpful, but I don't know the maximum number of plots in advance. Here is what I tried: shinyServer(function(input, output) { # Insert the right number of plot output objects into the web page output$densityPlots

Dynamically create plots based on number of uploaded files in Shiny

守給你的承諾、 提交于 2021-02-07 04:05:17
问题 I am trying to develop a shiny app where the user can upload csv files, which are subsequently analyzed by my R script. Therefore, I would like display a dynamic number of plots, based on the number of files that are processed (one plot for each file). I found this question extremly helpful, but I don't know the maximum number of plots in advance. Here is what I tried: shinyServer(function(input, output) { # Insert the right number of plot output objects into the web page output$densityPlots

Select multiple items using map_click in leaflet, linked to selectizeInput() in shiny app (R)

一世执手 提交于 2021-02-07 03:46:37
问题 I would like to create a leaflet map where you can select multiple polygons and this will update the selectizeInput() in a shiny app. This would including removing a selected polygon, when it is removed in the selectizeInput() . I have slightly changed/updated the code from the answer here (use of sf instead of sp and more dplyr where I could work out what the base R was). The polygons could probably be updated with an observeEvent tied in with input$clicked_locations , but not sure exactly

Select multiple items using map_click in leaflet, linked to selectizeInput() in shiny app (R)

喜夏-厌秋 提交于 2021-02-07 03:45:23
问题 I would like to create a leaflet map where you can select multiple polygons and this will update the selectizeInput() in a shiny app. This would including removing a selected polygon, when it is removed in the selectizeInput() . I have slightly changed/updated the code from the answer here (use of sf instead of sp and more dplyr where I could work out what the base R was). The polygons could probably be updated with an observeEvent tied in with input$clicked_locations , but not sure exactly

Display all values in a Shiny selectInput box (1000+)

廉价感情. 提交于 2021-02-07 03:40:31
问题 I am working an a Shiny app where I want to allow the user to pick from a longer list of genes (~1800) and then have corresponding graphs for the selected gene displayed. My problem is that I cannot get Shiny to display the whole list of genes available to select from in the drop-down menu of the selectInput box, it seems that only the first 1000 or so get displayed. Then I found a promising solution using server-side selectize, where all the available options get displayed when the user