Questions tagged [pander]

pander is a Pandoc writer in R.

Pander can convert various objects to markdown with various helpers functions and a generic S3 method, from which the most often used function (pandoc.table) returns data.frame or table like R objects in grid, simple, multi-line or pipe table syntax.

Beside the pander method the package also contains some helpers to act like brew˙with a robust cache and other added features (e.g. capturing and auto-styling images) and to transform literate reports to HTML/pdf/odt/docx directly with the help of Pandoc.

Questions tagged should also be tagged

151 questions
5
votes
4 answers

No table numbering with pander in bookdown:html_document2

pander does not include table numbering when used with bookdown::html_document2. Did I miss some option? --- title: "Pander Table Numbering" output: bookdown::html_document2 --- # Chapter 1 ```{r} library(knitr) library(pander) # Table…
Dieter Menne
  • 10,076
  • 44
  • 67
5
votes
1 answer

R Markdown - change default pdf table caption prefix

The default function (example Table: Table one) for getting table captions in your R Markdown pdf-documents is nice. But I struggle to change from default English "Table" to something else while at the same time keeping placement (above table) and…
ErrantBard
  • 1,421
  • 1
  • 21
  • 40
5
votes
1 answer

R, knitr, pander - How to nicely format summary() of dates

I am using summary() to generate simple summaries of date variables in a knitr document and want to have the results nicely formatted. summary(some_date) produces the results I want (the values are displayed as dates) but it is not nicely…
Ross Gayler
  • 653
  • 1
  • 8
  • 14
5
votes
0 answers

Convert rmarkdown .Rmd file to (knitr) sweave (.Rnw)

I have a rmarkdown document (.Rmd) that I've been doing some analysis in. I now realize I would prefer the functionality of LaTeX. Is there an easy way to convert the file to .Rnw, preserving the chunks (not just the body text)? Articles seem to…
Hugh
  • 15,521
  • 12
  • 57
  • 100
5
votes
1 answer

How can I keep pander from dropping trailing zeros?

How can I keep pander from dropping the trailing zeros when I'm simultaneously telling it to round values above their respective number of significant figures? In the following reproducible example, I'm trying to round a column of p-values for two…
Johan Larsson
  • 3,496
  • 18
  • 34
5
votes
1 answer

How to emphasize column names (header) when using pandoc in R

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…
Anna Dunietz
  • 825
  • 1
  • 9
  • 18
5
votes
1 answer

Column widths not aligned with table data in pander tables sent from R with sendmailr

I'm working with the 'pander' and 'sendmailr' packages to send a small data frame in the body of an email, rather than as an attachment. I'd like to send it from and to a gmail account. I'm close, but the column headers won't align with the columns…
Eric
  • 177
  • 1
  • 7
5
votes
1 answer

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

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…
Julian
  • 741
  • 8
  • 19
4
votes
1 answer

How to wrap text within a column in R when printing to the console?

I'm trying to adjust the way R prints a data frame to the console. Specifically, I want to print a data frame such that the text for a column wraps after a certain width is reached. Ideally, I want something that looks like the following: v1 …
Chernoff
  • 2,494
  • 2
  • 20
  • 24
4
votes
1 answer

Having multiple pander()s in a function

How do I create multiple outputs via pander() in a knitted document "asis" ? When I have multiple calls of pander in a function, only the most recent one is shown in the HTML output. Here's an example: tmp = function() { pander('A') pander('B') …
BurninLeo
  • 4,240
  • 4
  • 39
  • 56
4
votes
1 answer

Change default text color for kable tables inside Rstudio

I'm using R Markdown in RStudio and prefer to write code using a black background. My tables are formatted nicely in the output html document using kable. However, I've noticed that I can't read the output from kable because the text color is…
Nova
  • 5,423
  • 2
  • 42
  • 62
4
votes
1 answer

Pander with ftable and quotation marks in output

im trying to get a lovely 3-way crosstable using ftable with pander. In general output is ok, but row and column names are all in quotation marks which isnt ideal. example: library(pander) varA <-c("a","a","a","a","b","b") varB <-c(1,2,1,2,1,2) varC…
4
votes
1 answer

Put table captions on top when knitting Word .doc with R markdown

Table captions are positioned below the table when using R markdown to knit a Word document in RStudio. I need the table captions above the table. I have tried the kable() and pander() functions without success. A solution using xtable() when…
4
votes
1 answer

How to write (bullet) lists in a table using rmarkdown and pandoc

I am looking to create a table in a PDF document using rmarkdown, knitr and pander. The table should be nearly identical to Table 1 shown below, except the asterisks should be bullets. Is this at all possible using only the R libraries listed…
Anna Dunietz
  • 825
  • 1
  • 9
  • 18
4
votes
1 answer

Print a frequency table of a factor with kable in rmarkdown

I have a factor in R, that consists of the levels a, b and c. The data consists of 2 a's, one b and no c. I want to get an output like this (frequency of the elements according to the levels): fac <- factor(c("a", "b", "a"), levels=c("a", "b",…
BumbleBee
  • 986
  • 9
  • 19
1
2
3
10 11