yihui / printr

Some (magical) printing methods for knitr
https://yihui.org/printr/
118 stars 24 forks source link

Rmd partials #28

Open rubenarslan opened 7 years ago

rubenarslan commented 7 years ago

I like the concept of Rmd partials for repetitive things I do (like summaries of models, robustness checks, making a codebook for the items in a survey).

But I'm not sure I'm using them right, because it seems a bit hacky at times.

To give an example: here, you can see where I used one to summarise a regression with some plots and headlines (this is a simplified example, it's usually a bit more involved).

The partial itself: https://rubenarslan.github.io/repro_web_stack/_regression_summary.html Used: https://rubenarslan.github.io/repro_web_stack/3_analyses.html

Here are things that felt a bit hacky:

I was thinking of packaging some partials that I've made for myself, but wanted to collect your opinion on best practices first. Should I maybe use an htmlwidget-style approach for this as this is more "standard"? I like about the knit_child approach that I can treat it like text, concatenate several etc.