I know of the emphasize.rownames
argument but have not been able to find its equivalent for column names. Attempted to look into panderOptions --> header.style
to no avail.
Please find some test code below that emphasizes the first column but not its header. Ideally, I'd be able to specify which column names I'd like to emphasize but will be happy enough if I can at least emphasize the entire header. Thanks.
library(pander)
test = data.frame(Model = 1:3, Score = c(87,32,98), IQ = c(110,180,98))
# Print out the dataframe as a table using pander
pandoc.table(test, emphasize.strong.cols = 1)
EDIT
To clarify - I am looking to create a table in a PDF document using rmarkdown
, knitr
and pander
. Here is example code - I'd like the header to be emphasized, but it is not by default on my machine:
---
title: "myexample"
output: pdf_document
---
```{r myexamp_setup, message = FALSE, echo=FALSE}
require(pander)
require(knitr)
test = data.frame(Model = 1:3, Score = c(87,32,98), IQ = c(110,180,98))
```
```{r myexamp_tab, echo = FALSE, results = 'asis'}
pandoc.table(test, emphasize.strong.cols = 1)
```
pandoc
. If not, it depends on the stylesheet you are using. Can you share some more details on your use case? – Folkway