Shiny

Update plot from interactive table in html

依然范特西╮ 提交于 2020-01-15 06:38:08
问题 What I would like to be able to do is to update the plot based on the output from the (DT-)table after filtering in the html . For example - here is a screenshot of the table filtered for maz in the html: I would like the scatter plot to update to only show the values shown in the filtered table. Is this possible? I know I could achieve something like this using a shiny web app, but is it possible to embed some shiny code into the html to achieve this? (I have very limited experience using

What kind of object is this, reactive?

放肆的年华 提交于 2020-01-15 05:05:24
问题 I have this code in my Server.R : selection1 <- reactive({filter(filter(DF1, PC %in% input$dynamic), AGE >= input$age[1] & AGE <= input$age[2])}) DF1 is a data frame object of course, input$dynamic is a checkboxGroupInput and input$age is a slider input. But what kind of object is selection1 ? Is it a data frame too ? Then I would have liked to count the number of unique occurrences in variable COMMUN in selection1 , so I tried this : selection2 <- length(unique(selection1$COMMUN)) But I have

What kind of object is this, reactive?

岁酱吖の 提交于 2020-01-15 05:04:29
问题 I have this code in my Server.R : selection1 <- reactive({filter(filter(DF1, PC %in% input$dynamic), AGE >= input$age[1] & AGE <= input$age[2])}) DF1 is a data frame object of course, input$dynamic is a checkboxGroupInput and input$age is a slider input. But what kind of object is selection1 ? Is it a data frame too ? Then I would have liked to count the number of unique occurrences in variable COMMUN in selection1 , so I tried this : selection2 <- length(unique(selection1$COMMUN)) But I have

Knowing visitors identity on shiny R app

江枫思渺然 提交于 2020-01-15 04:26:27
问题 Is it possible to count the number of different visitors in an online shiny R app in time? Thank you in advance 回答1: You could define a reactive counter inside global.R that gets increased whenever a user connects and decreased whenever a user disconnects. Here is an example. library(shiny) # put this line in global.R in case you want to launch the app # with runApp (from a directory) rather than shinyApp nvisitors = reactiveVal(0) server = function(input, output, session){ nvisitors(isolate

Knowing visitors identity on shiny R app

徘徊边缘 提交于 2020-01-15 04:26:07
问题 Is it possible to count the number of different visitors in an online shiny R app in time? Thank you in advance 回答1: You could define a reactive counter inside global.R that gets increased whenever a user connects and decreased whenever a user disconnects. Here is an example. library(shiny) # put this line in global.R in case you want to launch the app # with runApp (from a directory) rather than shinyApp nvisitors = reactiveVal(0) server = function(input, output, session){ nvisitors(isolate

Shiny and twitter example

无人久伴 提交于 2020-01-15 04:19:58
问题 I'm trying to run a example to process tweets in R with Shiny. I'm using the example in this page, but I'm not getting any output. The code that I'm using is as follows (which I've corrected from the page as it had some errors with parenthesis, inverted comas, etc.): ui.r library(shiny) shinyUI(pageWithSidebar( # Application title headerPanel('Tweets hunter'), sidebarPanel( textInput('term', 'Enter a term', ''), numericInput('cant', 'Select a number of tweets',1,0,200), radioButtons('lang',

Shiny and twitter example

◇◆丶佛笑我妖孽 提交于 2020-01-15 04:19:12
问题 I'm trying to run a example to process tweets in R with Shiny. I'm using the example in this page, but I'm not getting any output. The code that I'm using is as follows (which I've corrected from the page as it had some errors with parenthesis, inverted comas, etc.): ui.r library(shiny) shinyUI(pageWithSidebar( # Application title headerPanel('Tweets hunter'), sidebarPanel( textInput('term', 'Enter a term', ''), numericInput('cant', 'Select a number of tweets',1,0,200), radioButtons('lang',

Shiny - Change background-color of htmlOutput conditionally

眉间皱痕 提交于 2020-01-14 18:46:43
问题 I have a shiny-app which is displaying name of a District through htmlOutput . Now these districts have a corresponding category - A/B/C, and based on whether category==A,B,C I want to set background-color of htmlOutput to 'red','blue','green'. I don't know how to conditionally change background-color. I'm fairly new to CSS. So far, I've been able to set the background-color but not change it by using the code below in ui.R (where dist is the tag used for htmlOutput displaying district): HTML

How to display in shiny app a matrix, specifying the color with conditionals?

安稳与你 提交于 2020-01-14 15:57:10
问题 I have a matrix M with positive values and negative values. I am trying to display as a table in shiny app, using the DT package. I would like to display the matrix with different colors. Positive numbers in red and negative numbers (for example). So far, I only can add colours in a one-to-one way . But I want to add colours in this way: if matrix_values > 0 "color1", if matrix_values < 0 "color2". M <- matrix(c(-3:2), 3) # The matrix is more complex and it's created in a reactive environment

How to display in shiny app a matrix, specifying the color with conditionals?

怎甘沉沦 提交于 2020-01-14 15:57:05
问题 I have a matrix M with positive values and negative values. I am trying to display as a table in shiny app, using the DT package. I would like to display the matrix with different colors. Positive numbers in red and negative numbers (for example). So far, I only can add colours in a one-to-one way . But I want to add colours in this way: if matrix_values > 0 "color1", if matrix_values < 0 "color2". M <- matrix(c(-3:2), 3) # The matrix is more complex and it's created in a reactive environment