I am currently starting to create an app in Shiny library, the idea is that I save in a dataframe values that I entered manually (from in input), I created an app (simple), but when I try to save each value that I entered manually (in the input) the previous value is erased. The code I have now is very basic but the depends you can move on with my app. I want to do is that every value I enter through the input I will saved on a vector or if I have multiple inputs each vector is a column of a matrix. I appreciate you can help me:
ui.R:library(shiny)
shinyUI(pageWithSidebar(
headerPanel( "", ""),
sidebarPanel(wellPanel(
textInput('datavalues', "Valor",""),
actionButton("submit","Guardar")
)
),
mainPanel(
verbatimTextOutput('datatable')
)
))
server.R: library(shiny)
shinyServer(function(input,output,session){
data1= reactive({
if(input$submit!=0){
isolate({
data.frame(paste(input$datavalues))
})
}
})
output$datatable<-renderPrint(function(){
if(!is.null(data1())){
d<-data1()
print(d)
}
})
})
Saludos,