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
19
votes
2 answers

Reduce cell width and font size of table using pandoc.table()

I'm using knitr and pander to make a table in a markdown file. I'm converting the markdown file to a PDF using Pandoc from within R. This code: library(knitr) ```{r myTable, echo=FALSE, message=FALSE, results='asis',…
luciano
  • 13,158
  • 36
  • 90
  • 130
15
votes
2 answers

Is there an option to control output page orientation (using knitr->pander->pandoc->docx)

I am playing with Tal's intro to producing word tables with as little overhead as possible in real world situations. (Please see for reproducible examples there - Thanks, Tal!) In real application, tables are to wide to print them on a…
aae
  • 439
  • 7
  • 18
13
votes
2 answers

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

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…
sparrow
  • 1,075
  • 1
  • 10
  • 17
13
votes
0 answers

Create an R statistical report in HTML with pander

I'm programming an statistical report in HTML with R and Sweave, but I can't improve the table format with xtable, so seeing the pander package by daroczig, I think that is enough to satisfy my purposes. The problem is when I run Pandoc.brew…
Rodian
  • 139
  • 4
9
votes
1 answer

Keep table dimnames in knitr or pander output?

I'm printing frequency tables using knit::kable and pander::pandoc, and generally this works great for HTML/Word/LaTeX output. But sometimes I'd like to preserve dimension names in the final product. Unfortunately, both pander and knitr drop these…
ChadBDot
  • 3,068
  • 1
  • 15
  • 12
9
votes
1 answer

In knitr, no output from pander in for loop

Using knitr in RStudio, pander does not produce any (or correct) html output when in a for loop. Here is a minimal case, as an Rmd input file. --- title: "Untitled" output: html_document --- Testing why pander doesn't work in for loop ```{r…
Eliot Smith
  • 93
  • 1
  • 3
8
votes
4 answers

! Undefined control sequence. with R/Rmarkdown/knitr

I'm new here, but I've spend few hours on R. I am using a combination of the R package Drake with knitr. However I have an error with the Rmarkdown file. I have a similar structure to the drake example (https://github.com/ropensci/drake), where I…
Vale
  • 81
  • 1
  • 4
7
votes
2 answers

table with long text, bullet points and specific table width

I want a table to have bullet points in one column and to have a specific table width (in order to be placed on one page when rendered to PDF). How can I achieve this in rmarkdown using one of the many packages out there? What I have tried and have…
symbolrush
  • 7,123
  • 1
  • 39
  • 67
7
votes
0 answers

How to add a horizontal line in table by using pander or pandoc.table

The header and content of a table generated by pander or pandoc.table is separated by a horizontal line. Is there a way to add a new horizontal line between a specific location in the content? For example: Any help is greatly appreciated. Thanks!
gh2017554
  • 71
  • 1
  • 2
7
votes
1 answer

Change default alignment in pander (pandoc.table)

I am currently switching to pander for most of my knitr-markdown formatting, because it provides such great pandoc support. One of the things I am not so happy with is the default center-alignment. Marketing people may love it, but for technical…
Dieter Menne
  • 10,076
  • 44
  • 67
7
votes
1 answer

tables in pander, style="multiline"

I'm using RStudio 0.98.1056 on Windows 7, and whatever the current version of pander is on CRAN as of today (I just installed the package). I'm trying to use the knitr->Markdown->.docx literate-programming workflow to create a table in Word. Some of…
ErinMcJ
  • 593
  • 6
  • 20
6
votes
0 answers

Grouping names for table column headings in RMarkdown for Word/docx output

I want to group column names in an RMarkdown table for the Word/docx output. Using pandoc.table: library(pander) pandoc.table(mtcars[1:3, 1:4], style = "rmarkdown") |   | mpg | cyl | disp | hp …
Mihail
  • 761
  • 5
  • 22
6
votes
1 answer

Bold formatting for significant values in a Rmarkdown table

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…
Ben
  • 41,615
  • 18
  • 132
  • 227
6
votes
1 answer

Generating pander tables in a loop in RMarkdown in Rstudio

I've a set of tables that I'm generating with use of the code similar to the snippet below: ```{r tables, echo=TRUE, eval=TRUE} require(reshape2); require(pander) data("mtcars") data("AirPassengers") dta_lst <- list(mtcars, AirPassengers) for (i in…
Konrad
  • 17,740
  • 16
  • 106
  • 167
6
votes
1 answer

Adapt pandoc.table column width

The below document gives the following HTML output (only HTML required) The first columns are way to wide, and Reduce cell width and font size of table using pandoc.table() does not help here. How can I force the first 2 columns to waste less…
Dieter Menne
  • 10,076
  • 44
  • 67
1
2 3
10 11