kcuilla / reactablefmtr

Streamlined Table Styling and Formatting for Reactable
https://kcuilla.github.io/reactablefmtr/
Other
208 stars 27 forks source link

Example in documentation for multiple tables? #70

Open tarlgordon opened 2 months ago

tarlgordon commented 2 months ago

I would like to create a page within R for multiple tables. It's very simple to do in xtable, but my co-maintainers have to know HTML and be willing to deal with it and we all have to learn CSS and JS to make them look half as nice as reactable tables. I'm looking for the next level of maintainability and utility, and looking to reactable and specifically reactable::save_reactable() (technically reactable::save_reactable_test() in the CRAN version, even though I don't understand the "_test" part of that) to be able to save the html output. My key output should have some text, an analysis table, some explanation text and maybe a plot, and a second table (and so on, if necessary).

I would like to be able to do something like this:

reactable(iris[10:19,]) %>%
  add_title("Important thing") %>%
  add_table(iris[20:29,]) %>%
  add_title("Follow-up data")

The first table that I create today is a high level summary of my data, and the second table I create today is the same summary but with one fewer column in the group_by() before I hit the summarize step. So, while it's kind of silly to have the iris examples like that above, it's only a handy pseudocode.

Anyway, since reactablefmtr has such handy add_ functions, I was wondering if you knew of a good way to paste together reactable elements into a bigger thing which I could then save_reactable_test() to html? Or is there a better way to accomplish this?