Shiny

ggplotly not working properly when number are facets are more

南楼画角 提交于 2020-01-24 01:05:05
问题 I am trying to create a Shiny Dashboard which contains Plots also. Plotly is such a great a package that it provides great visualization and interactivity to the users. But when i use ggplotly to convert my ggplot plots to interactive graphs, i am not getting the expected output and the issues get multiplied when the number of facets in the output are more. for example kindly find the code below. Source_Data_dupli <- data.frame( key = c(1, 1, 1, 2, 2, 2, 3, 3, 3,4,4,5,5,6,7), Product_Name = c

ggplotly not working properly when number are facets are more

倾然丶 夕夏残阳落幕 提交于 2020-01-24 01:04:14
问题 I am trying to create a Shiny Dashboard which contains Plots also. Plotly is such a great a package that it provides great visualization and interactivity to the users. But when i use ggplotly to convert my ggplot plots to interactive graphs, i am not getting the expected output and the issues get multiplied when the number of facets in the output are more. for example kindly find the code below. Source_Data_dupli <- data.frame( key = c(1, 1, 1, 2, 2, 2, 3, 3, 3,4,4,5,5,6,7), Product_Name = c

Restore input values with Shiny URL bookmark and rerun calculations

梦想的初衷 提交于 2020-01-24 00:58:08
问题 So I have a use case for a shiny app where the users can enter some value and when clicked on run it would run a model and show the values in the table. Now when I click on bookmark it captures the input values. And when I click on the restore bookmark it does populate the input values. What I want to do is after it restores the input values it should also run the model again and populate the values in the table. In short restore bookmark should populate the values and click on the run button

Shiny and rhandsontable - Conditional cell/column formatting based on column sum

北城以北 提交于 2020-01-23 21:41:54
问题 I have an rhandsontable inside a shiny app. My goal is to color all cells in a column based on the sum of the column. Ex : if the sum of the values in the column is 1, then, all cells in this column are colored in green. The expected outcome displayed to the user is like this: It seems possible to do so with a JS formatting like this : rhandsontable(myrhandsontable) %>% hot_cols(renderer ="some JS script") I have never done any JS before and I struggle to get the sum of the column inside the

Shiny and rhandsontable - Conditional cell/column formatting based on column sum

夙愿已清 提交于 2020-01-23 21:40:07
问题 I have an rhandsontable inside a shiny app. My goal is to color all cells in a column based on the sum of the column. Ex : if the sum of the values in the column is 1, then, all cells in this column are colored in green. The expected outcome displayed to the user is like this: It seems possible to do so with a JS formatting like this : rhandsontable(myrhandsontable) %>% hot_cols(renderer ="some JS script") I have never done any JS before and I struggle to get the sum of the column inside the

R - Shiny Filter for 'All' values

瘦欲@ 提交于 2020-01-23 18:23:51
问题 Is there a way to put a filter on a Shiny App, but for Shiny to know that if there is nothing selected to show all the data? For example, using the ggplot2 diamonds data, I've built the following: library(ggplot2) library(shiny) library(dplyr) diamonds <- diamonds #Unique cut dropdown cut <- sort(unique(diamonds$cut)) #Unique color color <- sort(unique(diamonds$color)) #Unique clarity clarity <- sort(unique(diamonds$clarity)) #Shiny App ui <- fluidPage( titlePanel("diamonds"), fluidRow(

Add reactive values from click events to existing data frame and update plot

折月煮酒 提交于 2020-01-23 16:27:08
问题 I'm new to using Shiny and having some problems with adding reactive values to an existing data frame. I would like to plot a scatter plot with a regression line using some preexisting data and update it with user clicks. I found a helpful example, but I can't figure out how to store the reactive values in a data frame in order to update the regression line. Here is what I tried. Thank you. library(shiny) ui <- basicPage( plotOutput("plot1", click = "plot_click"), verbatimTextOutput("info"),

How to use an editable DataTable in Shiny as input for another DataTable

ぐ巨炮叔叔 提交于 2020-01-23 09:50:09
问题 I want the user to be able to edit the already-loaded DataTable, click a button and then have the edited version used as input to do stuff. So in this example, how could I make the new user-edited versions appear in the "New" tabs upon clicking of the "Change Dataframes" button? User Interface shinyUI(fluidPage( titlePanel(), sidebarLayout( sidebarPanel( actionButton("runButton","Change Dataframes") ), mainPanel( tabsetPanel( tabPanel("OldIrisTab", DT::dataTableOutput("OldIris")), tabPanel(

How to use an editable DataTable in Shiny as input for another DataTable

余生颓废 提交于 2020-01-23 09:50:03
问题 I want the user to be able to edit the already-loaded DataTable, click a button and then have the edited version used as input to do stuff. So in this example, how could I make the new user-edited versions appear in the "New" tabs upon clicking of the "Change Dataframes" button? User Interface shinyUI(fluidPage( titlePanel(), sidebarLayout( sidebarPanel( actionButton("runButton","Change Dataframes") ), mainPanel( tabsetPanel( tabPanel("OldIrisTab", DT::dataTableOutput("OldIris")), tabPanel(

Getting multiple outputs from reactive

為{幸葍}努か 提交于 2020-01-23 07:47:47
问题 I need to get multiple outputs from reactive component in shiny. Example: output_a,output_b <- reactive({ a <- input$abc b <- input$abc*10 a b }) How could something like above be done through which I can get two outputs a and b from one reactive component? 回答1: So I had the same issue, I wanted two outputs from one reactive (I was using a for loop and an ifelse statement to assign variables to 1 of 2 lists, and I needed both lists to be returned). I found the following workaround, I'm not