no, reactiveValues purpose is to add objects to name you give it. you need to use the = operator like in my example to assign values to names in the reactiveValues.
you can use functions in there as per my example, but its not an appropriate place to define functions, howeveryou can define a function pretty much every where else...
library(shiny)
library(tidyverse)
ui <- fluidPage(
uiOutput("multitables")
)
customfunc<-function(x){
head(x)
}
server <- function(input, output, session) {
react_iris <- reactiveValues(
UpdatedValue0= iris %>% dplyr::filter(Species == "setosa") %>% customfunc(),
UpdatedValue1= iris %>% dplyr::filter(Species == "versicolor") %>% customfunc(),
UpdatedValue2= iris %>% dplyr::filter(Species == "virginica") %>% customfunc())
output$multitables <- renderUI({
tagList(
purrr::map(reactiveValuesToList(react_iris),
~renderTable(.))
)
})
}
shinyApp(ui, server)