Black Lives Matter. Please consider donating to Black Girls Code today.
Learn how to use COVID-19 data in open source Dash apps. Register for the Sept 23rd webinar with IQT!

[R] user defined variables and dataset

Using Plotly/R how can a user define which variables to plot from which dataset. Instead of hardcoding them I want to dynamically send plotly the variables and dataset to plot.
For eg
Plot variables V1 and V2 from dataset1 and variables V1 and V5 from dataset2 in the same plot.
The variables and dataset are not know before hand.