Questions tagged [kableextra]

kableExtra is an R package that helps to build common complex tables (in both HTML and pdf) and manipulate table styles. Using the pipe %>% symbol one can add "layers" to a kable output to get a well-formatted table.

680 questions
9
votes
5 answers

Increase line/row spacing with kableExtra

Is there a way to increase the line spacing with kableExtra for a pdf output in r-markdown or bookdown? library(knitr) library(kableExtra) kable( head(iris, 5), caption = 'Iris Table', booktabs = TRUE) %>% kable_styling(latex_options =…
Pete
  • 600
  • 1
  • 6
  • 16
9
votes
1 answer

The contents of kableExtra table invisible if RStudio editor theme is dark

I use a dark RStudio theme and try to print a knitrExtra table in R Markdown document. Unfortunately, the main contents of the table are invisible (i.e., white symbols on white background). Question: How to make kableExtra table contents visible in…
GegznaV
  • 4,938
  • 4
  • 23
  • 43
9
votes
3 answers

RMarkdown kable vertically align cells

I am authoring a report using RMarkdown, and using kable and kableExtra to format and print the table. Here is what I want would look like the table to look like (made in Word): I am struggling to sort the vertical centering (the space between…
azdatasci
  • 801
  • 1
  • 13
  • 32
9
votes
1 answer

kable kableExtra, Cells with hyperlinks

I am trying to create a table in an rmarkdown document and target HTML output, using the much appreciated and really awesome kable and kableExtra tools. The table needs to have cells with hyperlinks. While I can just put the URL's in a column of the…
Angelo
  • 2,936
  • 5
  • 29
  • 44
9
votes
4 answers

Problems rendering table using r Markdown, kable and kableExtra

I am attempting to output a latex table using r markdown, kable and kableExtra. I get an error in the table rendering code that is not part of the latex code produced by R. The code: outTab <- m.OutTab %>% kable(format='latex', booktabs=T , …
ABickford
  • 109
  • 1
  • 2
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
8
votes
1 answer

R markdown: How to create a table with images and text which should be knitted as PDF?

I would like to include a table with 2 columns including images and text (image descriptions) in PDF report compiled with R markdown. In doing so, I have the following requirements for my table: width: fixed column or table width alignment: content…
mavericks
  • 1,005
  • 17
  • 42
7
votes
1 answer

Merging column header in latex table created by kable in Rmarkdown

I have created a latex table as below using kable in Rmarkdown: --- output: pdf_document header-includes: - \usepackage{xcolor} --- ```{r, message=FALSE, warning=FALSE,…
lokheart
  • 23,743
  • 39
  • 98
  • 169
7
votes
1 answer

Kable (kableExtra) vertical scrollbar in knitted RMarkdown html_document?

The vertical scrollbar generated with kableExtra works in RStudio but doesn't work in the knitted html_document. Example Take the following Rmd file --- output: html_document --- ```{r setup, include=FALSE} knitr::opts_chunk$set(echo = TRUE,…
stevec
  • 41,291
  • 27
  • 223
  • 311
7
votes
3 answers

In RStudio, `knit` always works, but `rmarkdown::render` fails on second run (but not first!)

I'm trying to do something quite simple: generate reports in PDF format. Finally found a way that reproduces my issue. I need to use rmarkdown::render to create reports based on data in GlobalEnv. I am using the tinytex package. Here is…
Marian Minar
  • 1,344
  • 10
  • 25
7
votes
1 answer

xaringan: kableExtra::kable_styling() and wider tables

I am using xaringan to create an html presentation, which includes some tables generated using kable(). Unfortunately, these tables are quite narrow, so I'd like to use the full_width option in kable_styling. Moreover, I'd like to turn off the…
simoncolumbus
  • 526
  • 1
  • 8
  • 23
7
votes
3 answers

adding \label{} in kable kableExtra latex output

I am trying to create a latex formatted table in R with a \label{} option. Something similar to library(tidyverse) library(knitr) library(kableExtra) data_frame(a = 1:3, b = 2:4) %>% kable(align = 'c', format = 'latex') %>% …
Steve Reno
  • 1,304
  • 3
  • 14
  • 21
7
votes
3 answers

Is there a way to make a kable without lines/borders for pdf?

I'm working on a shiny-app that produces and sends a pdf-report, containing the wrangled data. The problem is that I can't get the table layout to look as the client want it to look. The client wants the tables to lack lines/borders except ontop of…
Allan A
  • 427
  • 8
  • 17
7
votes
1 answer

Citing within an RMarkdown table

I am attempting to create a table which has citations built into the table. Here is a visual of what I am trying to achieve. As far as I know you can only add footnotes in rowvars or colvars in kableExtra (love that package). # Create a dataframe…
Patrick
  • 915
  • 2
  • 9
  • 26
7
votes
2 answers

Vertical align kable's column name

Suppose the next example: library(knitr) library(kableExtra) df <- data.frame(a = letters[1:10], b = 1:10) names(df) <- c("This is a looooooong title, I don't know how to handle this... Also, I'm trying to extend this title even more... This…
aldo_tapia
  • 1,153
  • 16
  • 27
1
2
3
45 46