Include dynamic elements in Rmarkdown.

g2_action(plot_id, btn_id, ..., data = NULL, reorder = TRUE)



Id of chart to interact with.


Id of the input_button() that triggers the action.


Aspects, see asp().


Data.frame containing data to plot.


Whether to internally reorder the data, namely the x and color. The x axis must be reordered in a descending order for most data type since G2.js plots data as-is. Moreover, color order of all data.frames passed either to this function or subsequent fig_* layers must be identical or the colors will might match the legends on the plot. However, one may sometimes not want the data to be reordered.