I have a clunky block of shiny code on server.R side that I feel R syntax ought to allow me make one or two lines and simultaneously more flexible with some kind of lapply or do.call line
if(input$parVary == "area" && as.numeric(input$nTraces) > 3 )
{
area <- c(input$area, input$area2, input$area3, input$area4)
} else if(input$parVary == "area" && as.numeric(input$nTraces) > 2 )
{
area <- c(input$area, input$area2, input$area3)
} else if(input$parVary == "area" && as.numeric(input$nTraces) > 1 )
{
area <- c(input$area, input$area2)
} else
{
area <- input$area
}
But I have spent a day and about a billion different combos of lapply, do.calls, reactive, get, c, and observes around
paste0('input$area', 1:as.numeric(input$nTraces))
I just can't seem to find the right combination or figure out the reactive concept I'm missing. It -seems- to be related to the code not ever including individual input$area1, input$area2, etc... explicit text anywhere in the code?