I am currently working with reactable in R and I am trying to find a way to retrieve the last reactable object, similar to how ggplot2::last_plot() is used to get the last plot object. How can I achieve this?
library(reactable)
reactable(iris)
Now I want to retrieve the last reactable object.
Something like last_reactable() (doesn't exist).
This should work on a session base:
reactable) so that the quoted code of thetracerargument executes on each call toreactable:Above code grabs the arguments
reactablewas called with and stores it as a hidden list in the global environment.last_tablewhich callsreactablewith this list (= the latest arguments):last_reactablenow replays the latestreactablecall.