I wish to recreate a table like this where I insert a ggplot graph into a cell. I would like to use reactable to generate my table.
Any suggestions on how to proceed? I thought maybe I could use ggsave() to save the plot in png. I do not know however on to insert into a table.
Any assistance would be appreciated. thank you.
I had the same question myself, and the way I found is to create an
htmlwidget
with theggplot
inside it. Remember you can include any HTML widget in a reactable cell, that is what actually happens when using sparklines. So you can try something like this:Note: As asked by
@L Smeets
since all of this are widgets variables the height and width are variable i.e. they adjust with the window. But we can control it if you want and have fixed height and width, both for the whole table by controlling the reactable or the ggplotly. To set the height and width of the ggplotly widget: