I am working in RStudio for a course, and I want to write up my reports with R markdown. I would like to display certain console output in the pdf that will be the report, specifically the output of summary(model)
where model
is e.g. a linear model obtained by using the command lm
. The default seems however to be that the console output, after conversion to pdf with knitr, is displayed as-is and with '#'-symbols in front of it, which is both ugly to me and also quite cumbersome to deal with when tweaking the final layout of the report.
Is there any nicer way to display console output, specifically when converting my notebooks to pdf? Ideally, I would like something like a box surrounding the output (HTML conversion seems to give you just that) and optimally be able to add a caption to state what the output is representing. And most of all, no annoying '#'-signs on every row.
I have tried searching around here and googling for a solution, but I haven't found anything that solves my problem.