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
3
votes
1 answer

Adding a percent symbol to xtabs cells in r

I'm trying to use the R packages survey and pander for some quick table and report generation, but can't seem to format a table the way I need. I'd like to add percent symbols after the appropriate cells to the table. Here's my code to generate the…
Sterling
  • 65
  • 1
  • 6
3
votes
1 answer

How can I change the english captions in pander?

I am using pander to print nicer looking tables via RStudio, knitr, pander, pandoc, Word. I have a two-page table, to which I would like to add a Spanish caption: set.caption("Límites izquierdo y derecho para las diferentes…
ap53
  • 783
  • 2
  • 8
  • 19
2
votes
1 answer

Table in Bookdown/Huskydown with several features (Citation, Caption, URL, PNG Figure, ...)

I would like to include a table in an R markdown document (Bookdown/Huskydown) which should meet the following requirements. Ideally, the table works with several output formats, e.g. LaTex/PDF and HTML. Requirements: Table width: fixed Cell width:…
mavericks
  • 1,005
  • 17
  • 42
2
votes
0 answers

Table captions rendering above, not below, the table

I'm trying to create a table with a fairly long caption that I'd like to print beneath the table. When I use the pandoc.table function in the package pander, I can get this to work as long as I'm content with seeing the raw markdown output as…
ErinMcJ
  • 593
  • 6
  • 20
2
votes
2 answers

Italicising the headings of a dataframe in rmarkdown

I would like to apply some latex-style formatting to column headings in a pander table in rmarkdown, knitting to pdf. Notice in the toy document below the latex commands that work for the elements of the dataframe do not work for the headings.…
llewmills
  • 2,959
  • 3
  • 31
  • 58
2
votes
3 answers

R cran: saving a markdown document with command line

I am trying to create a package that generates automatically R markdown document and save then for the user. For creating the document, I will use the pander package (Programmatically generating formatted text in R markdown) but impossible to find…
CharlotteS.
  • 355
  • 1
  • 12
2
votes
2 answers

Rmarkdown Not Producing Table Within For In Loop

I'm trying to produce an automated report using Rmarkdown. In this report I have sections with tables. The sections are produced using the following Rmarkdown. However, it refuses to produce any tables(tried using kable and pander) when I hit knit.…
HSchmale
  • 1,838
  • 2
  • 21
  • 48
2
votes
1 answer

R: print table with pander

When printing a table with pander I obtain an error message Error in pandoc.table.return(...) : Wrong number of parameters (76 instead of *4*) passed: justify that I can't understand. a <- table(mtcars$mpg, mtcars$cyl) pander(a) Traceback: 6.…
GaryDe
  • 492
  • 1
  • 5
  • 17
2
votes
1 answer

numbering of split table in pander

using R + knitr + pander, for some reason a wide table that is split into more than two subtables gets more than one table number in the resulting pdf. For example, running the R Script test.R: library(pander) dat <- data.frame(a = rep(1:2, 13), b =…
Henrik
  • 65
  • 4
2
votes
1 answer

In R, how can we add significance stars to a kable() table?

Using knitr::kable() function to create a .doc table through rmarkdown, how could we add "significance stars symbols" from a given data frame (df.b) (i.e. cutpoints = c(0, .001,.01,.05, .1, 1), symbols = c("^{***}","^{**}","^{*}","^{.}"," ")) near…
AJMA
  • 1,134
  • 2
  • 13
  • 28
2
votes
1 answer

Centering pander tables

I am using pander in my Rmarkdown document to display tables. Is there away to center the table? I have tried a few different methods, but none of them seem to work. For example: {r, fig.align="center"} library(pander) test <-…
iskandarblue
  • 7,208
  • 15
  • 60
  • 130
2
votes
0 answers

How to create grid tables in word document report using R markdown

I was able to generate a word document report having a simple table using R markdown but I was not able to generate the report with table having grids. I tried to create a reproducible code. --- title: "Unable to create table having grids" output:…
radhikesh93
  • 870
  • 9
  • 25
2
votes
1 answer

Unicode characters not recognised by LaTex in RMarkdown Pander table

I am trying to get some greek characters into the rownames of a table in rmarkdown knitting to pdf. I am using knitr, pander and MacTex. It seems like pander accepts some unicode characters but not others. When i use \u2013 (emdash) it…
llewmills
  • 2,959
  • 3
  • 31
  • 58
2
votes
0 answers

R markdown pander over-ride automatic LaTeX table widths (column contains markdown URLs)

I have a table with a column containing markdown formatted links. When pander decides how wide to make the columns, it (understandably) takes the width of the URL into account. Is there a way to over-ride this behaviour so I can make this column…
James Owers
  • 7,948
  • 10
  • 55
  • 71
2
votes
1 answer

Pander formats tables weirdly when using significance stars and pandoc

If I run a linear regression with significance stars, render it through pander, and "Knit PDF" such as this: pander(lm(crimerate ~ conscripted + birthyr + indigenous + naturalized, data = data), add.significance.stars = T) I occasionally get…
Parseltongue
  • 11,157
  • 30
  • 95
  • 160