shiny-reactivity

how to change column names in rshiny using reactive function

|▌冷眼眸甩不掉的悲伤 提交于 2021-01-29 09:45:47
问题 I am uploading one csv file and to standardize the code I want to change the column names. so I am using following code: Prv_mnth_so1 <- reactive({data.frame(lapply(data_uploaded1(),trimws))}) colnames(Prv_mnth_so1()) <- c("GST_ward","Category","order_and_section","combo") but this throws an error Warning: Error in <-: invalid (NULL) left side of assignment 52: server [#12] Error in colnames(Prv_mnth_so1()) <- c("GST_ward", "Category", "order_and_section", : invalid (NULL) left side of

reactivity in timevis package: passing selectinput variable to subgroup

我与影子孤独终老i 提交于 2021-01-29 09:02:25
问题 Using the timevis package (dean attali) in R I would like to plot the timeline by group individually with a selectinput widget in r shiny: Error in : Can't subset columns that don't exist. x Column 2 doesn't exist. Can someone help? Thank you My code: library(shiny) library(timevis) library(dplyr) # constructing data frame pre_data <- data.frame( group = as.integer(c(1,1,2,2)), content = c("Item one", "Item two", "Ranged item", "Ranged item two"), start = c("2016-01-10", "2016-01-11", "2016

Shiny Dynamic UI Resetting to Original Values

泪湿孤枕 提交于 2021-01-29 08:39:17
问题 I have created a dynamic UI with the number of rows of a 'table' defined by a slider. I would like to use the numericInputs from the UI to perform further calculations. In the example below I have tried to calculate a rate from the two numeric inputs, which seems to work when new values are entered but immediately defaults back to the original starting values. I tried using a button and changing the observe to an observeEvent to calculate the rates which worked to generate the result, but did

R Shiny Reactive values, dplyr filter error?

一世执手 提交于 2021-01-29 08:29:20
问题 I am trying to figure out as I select input in UI to immediately reflect the results on page. My search results led me to look into reactive expression and reactive values. But as I am trying to filter the value on data, I think it is causing some complication yet I have no clue what I am supposed to do with this. It seems like the filter function doesn't seem to work though. This is the error message: Warning: Error in UseMethod: no applicable method for 'filter_' applied to an object of

Returning a dataframe in a reactive function in R Shiny Dashboard

浪子不回头ぞ 提交于 2021-01-18 07:14:20
问题 Working with a Shiny Dashboard, ui.r, server.r and several r scripts that contain functions. Base problem is: I have two data sets that I bring into the server.r and I pass those to a function the prepares/cleanses the data sets and then binds them together and should return a complete dataframe. The dataFrame should be reactive. Here is what I have so far: In the server.r I load the data prior to the function(input, output, session). Then I have: ################server.r code ###############

Returning a dataframe in a reactive function in R Shiny Dashboard

那年仲夏 提交于 2021-01-18 07:13:35
问题 Working with a Shiny Dashboard, ui.r, server.r and several r scripts that contain functions. Base problem is: I have two data sets that I bring into the server.r and I pass those to a function the prepares/cleanses the data sets and then binds them together and should return a complete dataframe. The dataFrame should be reactive. Here is what I have so far: In the server.r I load the data prior to the function(input, output, session). Then I have: ################server.r code ###############

How to hide or display charts in shiny dashboardBody based on radioGroupButton selection

安稳与你 提交于 2020-08-08 04:06:13
问题 I am trying to create this dashboard with following structure. It basic structure has 3 levels (Menu, sub Menu and radioGroupButton selection) SideBar: Menu1: has 2 sub menus (Sub Menu 1 and Sub Menu2) Menu2 has 2 sub menus (Sub Menu 3 and Sub Menu4) The body has radioGroupButton that has 2 choices dashBoardBody: RadioGroupButton: Choice 1 and Choice 2 So when the user clicks Sub Menu1 and clicks Choice 1 then I need to display #A1 Sub Menu1 and clicks Choice 2 then I need to display #A2 Sub