r - Changing reactiveValues inside observeEvent in Shiny -
i new shiny. couldn't figure 1 out since don't think understand how reactivevalues
work.
i want trigger eventreactive
functions (dependent on reactive value appendscenarios$app
) whenever find new column csv file read (input$file
), after user clicks button (input$generate
). however, seems last column csv file being used in other functions , there absolutely no change in value of appendscenarios$app
following cat
's show: (following code-block server.r
)
newentry <- observeevent(input$generate, { infile <- input$file pricescens <- read.csv(infile$datapath)[,-1] (i in (4:ncol(pricescens))) { sce.name.csv <<- colnames(pricescens)[i] new.price.csv <<- as.numeric(pricescens[,i]) newval <- appendscenarios$app + 1 cat("appendscenarios$app ", appendscenarios$app, "\n") #same below cat reactive(appendscenarios$app <- newval) cat("appendscenarios$app ", appendscenarios$app, "\n") # same above cat } })
note: sce.name.csv
, new.price.csv
used in of eventreactive
functions listen appendscenarios$app
.
Comments
Post a Comment