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

Replacing colnames on a pandoc table

Given the following example library(pander) table <- Titanic[1, 1, , ] tableWithMargins <- addmargins(table) pander(tableWithMargins) ----------------------------   No Yes Sum ----------- ---- ----- ----- **Child** 0 5 5 …
Waldir Leoncio
  • 10,853
  • 19
  • 77
  • 107
3
votes
2 answers

R Markdown, output test results (htest) when chunk option results="asis"

I need to use results = "asis" for reasons stated here: https://stackoverflow.com/a/36381976/ However, using that chunk option means other outputs render non-ideally. Specifically I'm having issues outputting prop.test results, but I'm sure this…
conor
  • 1,204
  • 1
  • 18
  • 22
3
votes
1 answer

Emphasizing cells using emphasize.strong.cells fails - POSIXct related?

I am attempting to display the following table (which contains two columns of class POSIXct) and emphasize cells that contain a certain value ("B"). > test bikeid start_station starttime end_station endtime 1 1 …
iskandarblue
  • 7,208
  • 15
  • 60
  • 130
3
votes
0 answers

Make xtable/pandoc.table fit to page size OR adjust cell height to text length

I am trying to create a publication quality table, that describes the variables I have used in the analysis. Thus the table has two columns and say 20 rows. The first column is short as it contains the variable name and the second column is rather…
3
votes
0 answers

pander control column width

table output I am trying to create a table to hold some basic information using Kable in RMarkdown that will be generated in HTML, PDF, and Word. I have used pander function to do that and adjust some options such as split.table, split.cells, but it…
Bin
  • 517
  • 1
  • 4
  • 15
3
votes
3 answers

pander number of digits after decimal point

I am trying to output a table using pander in a .rmd file as a pdf with 2 digits following the decimal point, but I get no digits using the following rmd: --- title: "Long table test" output: pdf_document --- Here is a table: ```{r setup} library…
David
  • 759
  • 2
  • 9
  • 19
3
votes
1 answer

sharing 2 data tables through sendmailR

I am using below code to share the data frame "my_data1" with my friend and the code is working fine. But I have another data frame "my_data2" that I want to share. Please suggest where and how should I add the second table in my…
3
votes
1 answer

Not able to send the pander table intact in Gmail using sendmailR

Please find below my code that I am using to share my analysis (dataframe) with my friend in R. I am using sendmailR package and pander: library(sendmailR) from <- "" to <- "" subject <- "Important Report of the…
AkshitR
  • 33
  • 3
3
votes
2 answers

Combine tables in R Markdown

I am trying to combine two tables in R Markdown into a single table, one below the other & retaining the header. The figure below shows the desired output. After putting my markdown code I will show the actual output. I realize that the way I have…
Krishnan
  • 1,265
  • 2
  • 13
  • 24
3
votes
2 answers

How to write multi-level (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. I am able to create a simple bullet list but now require another level in that list. In the table shown below, I require the "Rave reviews" bullet to be a sub-bullet…
Anna Dunietz
  • 825
  • 1
  • 9
  • 18
3
votes
1 answer

Generate a pandoc table without repeated values

I use pander to generate pandoc style tables, often I need to suppress repeated values of variables like this example: ta <- data.frame(class=c(rep("C1" ,3), rep("C2", 6)), name=rep(c("L", "V", "C"), each=3), num=rpois(9,…
Leosar
  • 2,010
  • 4
  • 21
  • 32
3
votes
1 answer

Keep trailing zeros for percents only

Given the following example: library(pander) tableAbs <- Titanic[1, 1, , ] tablePct <- round(prop.table(tableAbs) * 100, 2) table <- cbind(tableAbs, tablePct) pander(table) ----------------------------------   No Yes No Yes…
Waldir Leoncio
  • 10,853
  • 19
  • 77
  • 107
3
votes
0 answers

Knitting RMarkdown to Word loses internal anchors

I am knitting an Rmd file to docx (required by the client) and have come across a weird issue: if I knit to HTML, internal anchors I've included work (so they can click on "Table 1" and it will take them to it. However, if I knit to .docx, the…
Twitch_City
  • 1,236
  • 1
  • 10
  • 22
3
votes
1 answer

How to position and format length of a table's title [R Markdown, pander package]

I am preparing R Markdown document in the pdf format. In the document I have a couple of tables. I used pander package to format tables. Suppose that I have data frame, DF, that I want to transform into table in the pdf output. To achieve…
Newbie_R
  • 655
  • 7
  • 22
3
votes
1 answer

How do I remove row names when using pander to brew a report?

I'm trying to get my head around using R to generate reports and think I have settled on trying to just use pander, after confusing myself with various combinations of knitr, Rmarkdown, pander and reports. I now have two files: 'ReportIntro.brew'…
Jerubaal
  • 65
  • 1
  • 7
1 2
3
10 11