pander

Issue with Pander+Knitr: Error when using pander.list

元气小坏坏 提交于 2019-12-01 06:03:44
Another reproducible error with pander (+ knitr): When I try to pander a list, I cannot create a PDF File - it seems to occur when a table or data.frame is put inside the list. If only vectors are in the list, the PDF compiles but looks ugly. I use pander 0.5.1, knitr 1.7, R version 3.1.1, Miktex + RStudio on Windows. Doesn't work: ```{r, eval=FALSE} pander(list(cor=cor(cars) ) ) ``` Error: output file: Preview-e905ccd5f1a.knit.md ! Undefined control sequence. l.246 \textbf{cars}: {[}1{]} ``\n pandoc.exe: Error producing PDF from TeX source Fehler: pandoc document conversion failed with error

How to set the number of decimals in report produced with knitr/pander?

那年仲夏 提交于 2019-11-30 13:46:18
I know it's a fairly old problem, and it has been discussed before, but I can't get it work as expected. I have a markdown document, and I would like to use knitr and pander to produce a .docx report with a consistent numeric format with two decimals, such as 0.12, 3.60, 14.00, or 163.21 for both inline and chunk outputs. I have read this thread How to avoid using round() in every \Sexpr{}? where it was suggested that pander can do that automatically. However, it does not seem to work for me. Please let me know what I'm missing here. The script: ```{r, echo=FALSE} library(knitr) opts_chunk$set

Bold formatting for significant values in a Rmarkdown table

让人想犯罪 __ 提交于 2019-11-27 19:02:10
问题 I want to make a correlation matrix of r values (for Pearson's correlation coefficient), and programmatically apply bold formatting to values where the p-value is less that 0.05 or 0.01 or whatever. These kinds of tables are pretty common in scientific literature, so it would be useful to have a simple way to produce them when using Rmarkdown. For example: # compute matrix correlation library(Hmisc) df3 <- rcorr(as.matrix(mtcars), type="pearson") # we get a list of three items, first item is