Produce a table spanning multiple pages using kable()

I would like to produce a table that spans over multiple pages using kable(). I know this is possible using xtable() with the "longtable" option, but I need kable() for other features. Any...

Wrapping footnote to second line to fit table in kable (LaTeX .Rmd)

I'm wondering if there is a way I can force a footnote to fit the width of a table (and wrap to a second line) using kable in R (I'm knitting .Rmd to PDF so the format is latex). I've used both...

Adding background image to R Markdown (.rmd) file for PDF document?

I have seen this post to include a background image to an R markdown report. I have created a Shiny app to generate a pdf report: shinyApp( ui = fluidPage( sliderInput("slider", "Slider", 1,...

Fix header on top with kable or DT

I'm trying to include a vertically scrollable table in my html output. The table looks stunning, but I would like to fix the header on top (while right now it scrolls up like everything else). A...

Prevent pagebreak in kableExtra landscape table

How can a landscape table be plotted in R Markdown (PDF output) without causing a page break to be inserted? There is the function landscape from the kableExtra package, but this forces a page...

Unable to install dependencies for package kableExtra

I recently upgraded Ubuntu 16.04 to 18.04 and started having problems concerning rvest and xml2 in my R installation. I'm trying to install package kableExtra but i keep getting errors even though...

kable showing html code instead of html table

I was trying to use kable to generate a beautiful table. However, kable just returned the html code instead of the table itself in r notebook (R version 3.5.0, R Version 1.1.453 on a Mac). #Test...

Rmarkdown setting the position of kable

I have the following issue, once knitting the Rmarkdown in Rstudio to PDF, my tables appear not in the position where they are in Rmarkdown file, but on the top of the page. I tried to...

Coloring rows with kableExtra based on cell values

I use R markdown in combination with LaTeX to create PDF reports. To generate tables I use the kableExtra package. I'd like to change the styling of rows based on the values in a particular...

row_spec() function from kableExtra does not create a horizontal line in html output

I would like to add a horizontal line under one of the rows in my kableextra table. The parameter hline_after for row_spec function is supposed to add the horizontal line under the row: row_spec...

R kable won't print in Markdown document

I have recently tried to use the kable package for tables, and while I'm quite satisfied of the results I'm getting in R scripts, I can't figure out how to use them in an R Markdown file. Here is...

Row indentation with add_indent() in 2nd column in kableExtra

I try to indent cells of the 2nd column of a dataframe using the kableExtra-package for RMarkdown. It seems add_indent() only works for the first column, therefore does not change anything in my...

How to group rows in kableExtra with a grouping variable: `pack_rows()`?

library(kableExtra) library(tibble) MWE dataset (group = grouping variable) tib <- tibble(group = c("a", "a", "b", "c", "c", "c"), var = 1:6) This is what I want to...

Captions using R "tables" package with kableExtra formatting

I am trying to add a caption to a table output from the package "tables" in R followed by additional formatting using kableExtra. Although other threads have found ways to add caption headers by...

Set whole cell background color using kableExtra

I am creating a dashboard for dispatching trucks at my company. I created a table in Shiny that shows which trucks should be dispatched from which dock and certain times. The cell background is...

kableExtra::collapse_rows does not work properly with longtable headers that are multiple lines

kableExtra::collapse_rows does not seem to correctly place the row group name on subsequent pages when using knitr::kable(longtable = T). collapse_rows() row group name overlaps with longtable...

How to save a table as an image but also preserve its quality? R

Looking for tips to save a table as an image with the quality seen in the RStudio Viewer. I've tried save_kable and as_image but both resulted in serious drops in quality. Any other...

error in add_p()' for variable X and test 'fisher.test', p-value omitted

I get the error below when I try to use the add_p() function to get a p-value for differences between my by variable (with 10 levels) and a categorical variable with two levels (yes/no). I am not...

Cross-referencing a table or figure in rmarkdown in the caption of another figure or table

I am producing a rmarkdown document, knitting to PDF and have a figure (figure 1) and a table (table 1) where the table explains the figure in more detail. I have no issue giving either of them a...

! 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...

Use kableExtra's kbl() and save_kable() to export table as word table to word document?

Is there a way to export or knit a table directly to word-format in an R-script (instead of R-markdown)? knitr and kableExtra seem to provide a wide range of options to save tables, yet there is...

kableExtra: How does the add_header_above function work?

I want to add a row explaining the columns of my table. But the add_header_above function is a bit confusing. How do you use it? This is the built-in example: x = kable(head(mtcars), "html") # Add...

Placing one box per row in shinydashboard

First time poster here. 1. Background I want to create a dynamic UI of boxes and graphs placed inside those boxes in shinydashboard. I found this blogpost that perfectly suits my needs: Create a...

KableExtra using row_spec in collapsed rows

I have a dataset that is set up like the following mtcars summary: mtcarssumm <- mtcars %>% group_by(cyl, gear) %>% summarise(meanMPG = mean(mpg)) %>% mutate(gear=as.character(gear)) %>% ...

collapse_rows is not collapsed and updating packages does not fix

This script does not work for me. The table outputted does not have collapsed rows. I already updated all my packages. Can someone...

In RMarkdown, why is the kable table printing below the header here?

I'm trying to generate a report with each row of a tibble printing vertically in a table on its own page using a for loop. The tables are printing fine, but I want to put headers at the top of...

Add new line to table cell in rmarkdown kable. Linebreak \n not working for latex output

I am creating a longtable in rmarkdown, which is text heavy. I'm setting the column width using column_spec to space text over multiple lines, but would like to insert manual line breaks to...

How to print single asterisk in R Markdown table using 'kable'?

I created a table in an R Markdown document which I want to print in html format using kable and kable_styling from the kableExtra package. One column contains cells that should only show one...

Knitting stargazer summary statistics table in R Markdown to Word

Context: I am using R markdown to produce a short report in Word format. In the R markdown file, I use stargazer to produce summary statistics tables to be included in the final Word document. I'm...

Citations in KableExtra table missing when format = "latex" and using custom csl

After updating a Bookdown project to include a custom .csl file for citations, citations included within a kableExtra table stop working but only when format = "latex" when creating a PDF...