Hi, here is an example of what I would like to do:
```{r markdown setup, include=FALSE}
knitr::opts_chunk$set(echo = FALSE,
message = FALSE,
warning = FALSE)
```
```{r}
data <- data.frame(a = c(1,2,3),
b = c(4,5,6))
```
```{r}
inputPanel(
actionButton("calculate", "Calculate"),
actionButton("add", "Add")
)
```
```{r}
myObj <- eventReactive(input$calculate,{
return(cbind(data, data))
})
myObj <- eventReactive(input$add,{
return(cbind(myObj(), myObj()))
})
```
```{r}
DT::renderDT({
DT::datatable(myObj())
})
```
As you can see, i have a reactive value "myObj", that I would like to change every time the second action button is clicked.