Menu
  • HOME
  • TAGS

Increase columns in Pander

r,pander

Sure, the general options are your best friend when it comes to pander: > panderOptions('table.split.table', Inf) > pander(head(iris)) ------------------------------------------------------------------- Sepal.Length Sepal.Width Petal.Length Petal.Width Species -------------- ------------- -------------- ------------- --------- 5.1 3.5 1.4 0.2 setosa 4.9 3 1.4 0.2 setosa 4.7 3.2 1.3 0.2 setosa 4.6 3.1 1.5 0.2 setosa 5...

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

r,rmarkdown,pandoc,pander

The default multiline style table does not support arbitrary block elements inside of the cells, but the grid tables does. So this is possible, just make sure: you use grid style align the cell to the left use hard line breaks at the end of the list elements and enable...

Print a frequency table of a factor with kable in rmarkdown

r,knitr,rmarkdown,pander

You could try > kable(t(as.matrix(tbl))) # #| a| b| c| #|--:|--:|--:| #| 2| 1| 0| ...

how do you convert a data frame to a table to send as an email body

r,pander,sendmailr

What do you mean under? the table looks very plain You may also opt for some other markdown format for the table, like passing style = 'grid' to pandoc.table.return, if you do not like the default multiline format. Or you mean the table falls apart/looks ugly with a non-monospace font?...

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

r,rmarkdown,pandoc,pander

Please consider opening a ticket on GitHub for this feature request -- but until this is not supported, I hope the following workaround might help: > names(test) <- pandoc.strong.return(names(test)) > pander(test, emphasize.strong.cols = 1) -------------------------------- **Model** **Score** **IQ** ----------- ----------- -------- **1** 87 110 **2** 32 180 **3** 98 98...

Tables with column- and row-percentages using pander and CrossTable?

r,knitr,pander

This has been fixed in the development version of pander with a recent commit: > pander(descr::CrossTable(x, y, prop.chisq=FALSE, prop.t = FALSE), split.table = Inf) ------------------------------------ &nbsp; 1 2 Total --------- -------- -------- -------- **1**\ &nbsp;\ &nbsp;\ &nbsp;\ N\ 1\ 1\ 2\ Row(%)\ 50%\ 50%\ 50% Column(%) 50% 50% **2**\ &nbsp;\...

Generate a pandoc table without repeated values

r,dplyr,pandoc,pander

This seems like an open bug that will be corrected. In the meantime this workaround seems to do the job: mutate(ta, class=ifelse(levels(class)[lag(class,1)] == class & !is.na(levels(class)[lag(class,1)]), "", class)) class name num 1 1 L 8 2 L 14 3 L 12 4 2 V 11 5 V 7 6 V...

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

r,rmarkdown,pandoc,pander

You can nest the items inside the bullet: ```{r concepts, echo=FALSE} mytable = data.frame( Concept = c("Decoded", "XXX"), Description = c("* Founded in 2011\ \n * Offers workshops to take people from zero skills and knowledge in programming through to coding a multi-platform app using HTML, CSS and Javascript in...

Keep trailing zeros for percents only

r,rmarkdown,pandoc,pander

Thanks to rawr in the comments. You can use format to keep the trailing zeros. This converts the rounded values to character while preserving the dimensions of the table. tablePct <- format(round(prop.table(tableAbs) * 100, 2)) edit Seems to work okay with xtabs class mtcars$am[mtcars$vs == 1] <- 0 x <-...

R: Pander sink stack full when printing summary lm

r,sink,pander

Actually, if you're just running a standard lm regression, don't pass the summary.lm object to pander, pass the model itself (the lm object) pander(a.lm) That should have the information you need. The function calls summary() internally....

How do I specify the output file name when using pander's live report generation?

r,pander

Use the first or f argument based on the sources. E.g.: myReport <- Pandoc$new(author="Jerubaal",title="What's my file name?", format="docx") myReport$add.paragraph("This is it.") myReport$export('this_is_the_file_name.docx', open = FALSE) Please feel free to send a pull request or suggestion for an updated documentation....

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

r,pander,sendmailr

The problem with plain text e-mails and using markdown tables is that the e-mail client usually displays the text with a non-fixed font, and you have to use custom settings in all your e-mail client to override that (like you did with your OS X e-mail client). On the other...