I want to define a list that a user may update through doing certain actions. I did this:
runApp(list(
ui=fluidPage(
h1(\'Example\')
,textInput(\'txt\'
You can use reactiveValues
require(shiny)
runApp(list(
ui=fluidPage(
h1('Example')
,textInput('txt','','Text')
,actionButton('add','add')
,verbatimTextOutput('list')
)
,server=function(input,output,session) {
myValues <- reactiveValues()
observe({
if(input$add > 0){
myValues$dList <- c(isolate(myValues$dList), isolate(input$txt))
}
})
output$list<-renderPrint({
myValues$dList
})
}
))