codecheckers/codecheck

Simple collection of outputs in certificate

Opened this issue · 2 comments

sje30 commented

I'd love to replace the kind of crufy solution I have now for including manifest files in the certificate, e.g. I have :

{r, echo=FALSE, fig.cap=manifest_df[1:4,"comment"]}
knitr::include_graphics(manifest_df[1, "dest"])
cat('\n\n')
knitr::include_graphics(manifest_df[2, "dest"])
cat('\n\n')
knitr::include_graphics(manifest_df[3, "dest"])
cat('\n\n')
knitr::include_graphics(manifest_df[4, "dest"])
cat('\n\n')

whereas what I'd like is a simple chunk that by default will include all the manifest files intelligently into the Rmd. e.g. if given a figure (png/pdf/jpg), it calls include_graphics, else for csv it shows a tiblle summary of the data frame... just need some R magic to get it working.

sje30 commented

maybe we should go the other way, and simplify it so that each code chunk does one output?

nuest commented

One chunk per output is a very good idea.

I'd not be sure though that you can automate this fully, so I'd tend towards not trying to automate anything but provide snippets for the author of a report.