this is my first question on StackOverflow. I’ve tried to make it as clear as possible, but I am also very open to feedback!
I am creating an app with R shiny to analyze two dimensional data (Time and Value) for multiple samples.
I would like the application to:
Import the sample files.
Recognize the number of samples in the uploaded files.
- Create a selectInput bar for each sample.
- Create a ggplot object for each sample.
Huge thank you to Pork Chop for pointing out the similarities to this question - that solved my multiple selectInput bar issue. Also thank you to camille for suggesting purr's map function, that helps me create a list of ggplot objects without fuss.
However, I am still struggling to get all of the ggplot objects to display in Shiny. I have used this approach for inspiration but the author uses a for loop with static length. I tried their approach, just to see if it works, but it also only gives me the first plot of my list of plots.
Here is a very basic example of my current approach. Maybe something with map/lapply with renderPlot? i.e. map(plot_list, renderPlot({})) ?
Sincerest thanks again for your help and patience.
EDIT: finally managed to solve my issue with a lot of help from this post! Instead of using max_plots I created a reactive value for number of samples, and was able to get the plots to display properly once I added observe({}).