I have an app that generates several tables whose id's only differ by a suffixed number. While I currently copy and paste most of my code to create all these panels like so:
# Panel 1
panel1Data <- reactive({panelData(1, input$hsyear1, input$panel1range)})
output$panel1plot <- renderPlot({panelPlot(panel1Data(), 1)})
# Panel 2
panel2Data <- reactive({panelData(2, input$hsyear2, input$panel2range)})
output$panel2plot <- renderPlot({panelPlot(panel2Data(), 2)})
I want to use lapply
or any other function to make this more dynamic so that I can make my code a bit easier on the eye. How would I go about doing this?