Hi there. I'm wondering if there's a way to dynamically generate plots in a Shiny app. I want to generate plots for each column in the dataset uploaded to my app, but I have a critical problem. Depending on the type of data in a column, I create:
- a bar plot for categorical data
- for numerical data: histogram, boxplot or density plot.
There are two picker inputs for both categorical and numerical variables. Each plot is in a separate bslib card, for numeric plots there's a select input in the card header, so the user can choose plot type. By default, I generate plots for all categorical and numeric variables, but when I change the set of selected variables in a picker input, all plots for either numeric or categorical variables are generated again. It's very annoying, especially when I pick another plot type for numeric variable, and when I select/deselect numeric var it is generated again in a default type. I'm wondering if there's a way to avoid this, so that when I select a particular var, only one plot is generated or hidden when I deselect a var. Thanks in advance for your help!