I am using RStudio 0.98.1056 for Windows 7, and whatever the current version of pander on CRAN is today (I just installed the package).
I am trying to use the workflow knitr-> Markdown β. docx to create a table in Word. Some of the cells must contain hard line breaks. I believe that this should be possible based on the information in the following link:
http://rmarkdown.rstudio.com/authoring_pandoc_markdown.html
It says: "A backslash followed by a new line is also a hard line break. Note: in multi-line grid cells and a grid, this is the only way to create a hard line break, since trailing spaces in cells are ignored."
I am trying to create a table with cells containing line breaks as follows:
library(pander) a <- c(1:10) b <- c(11:20) ab <- paste(a,b,sep='\n') N <- ceiling(rpois(10,9)) labels <- paste("Question",c(1:10)) mytable <- data.frame(labels,ab,N) pandoc.table(mytable, style="multiline")
But the new line is just stripped. Same thing if I use sep = "<newline>" or sep = "<br>" (without leading spaces). I also tried adding an extra backslash in case R βateβ the first; and the inclusion of an insert function to include each of these possible delimiters as its own term, rather than in the sep = argument. None of these things worked.
I tried the sample code in the pander reference documentation, just like a health check, and it seems that the problem in general is the sample code, which I thought should create multi-row tables on my machine.
Has anyone else got multi-row tables in pander to work?
source share