Questions tagged [kable]

Create Tables In LaTeX, HTML, Markdown And ReStructuredText

A function from R knitr package by Yihui Xie.

This is a very simple table generator. It is simple by design. It is not intended to replace any other R packages for making tables.

Related tags:

795 questions
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
2 answers

table with long text, bullet points and specific table width

I want a table to have bullet points in one column and to have a specific table width (in order to be placed on one page when rendered to PDF). How can I achieve this in rmarkdown using one of the many packages out there? What I have tried and have…
symbolrush
  • 7,123
  • 1
  • 39
  • 67
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
1 answer

How to create table in rmarkdown using greek letters in column headers?

I am trying to create a table in rmarkdown with kable and kableExtra and I want to put greek letters in the add_header_above function. kable(a, format = "latex", booktabs = T, longtable = T) %>% kable_styling() %>% add_header_above(c("n",…
falecomdino
  • 87
  • 1
  • 6
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
7
votes
1 answer

kableExtra only works if there's another table in the presentation?

When I use kableExtra for a PDF output, the table renders beautifully, BUT gives an error if there isn't another, non-kable extra table in the program. Has anyone else seen this behavior? the file appears to knit fine, but then throws an error in…
M. M.
  • 109
  • 2
  • 7
7
votes
1 answer

Changing column width in R's kable does not change width of headers

I am using kable to make tables of my data in RMarkdown. You can supposedly adjust column width using the column_spec command, however this seems to adjust only the columns of the data, itself, but does not also adjust the column width of my header…
Alison K.
  • 71
  • 1
  • 2
6
votes
1 answer

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 no option to export tables as actual word…
Dr. Fabian Habersack
  • 1,111
  • 12
  • 30
6
votes
1 answer

Combine kableExtra tables with ggplot2 elements

I have a ggplot2 element and a KableExtra table. Is it possible to combine them into one object with patchwork, cowplot or any other package and print it in an rmarkdown document? If there's not a solution, is there any other table package, with…
daniellga
  • 1,142
  • 6
  • 16
6
votes
0 answers

kableExtra won't compile with full_width and XeLaTeX

Having full_width = T in my kable function results in the error: ! You can't use `\relax' after \the. \tabu@elapsedtime ...optime {\the \pdfelapsedtime }\tabu@message {(tabu)\tab... But…
David
  • 432
  • 3
  • 10
6
votes
0 answers

R kable linebreak cutting off striped color

Below is a code example. My issue is that the background color for the rows with the linebreak are being cut short. Any idea how to fix this? I tried limiting the column width and that did the trick, but with other unwanted side effects such as…
David
  • 432
  • 3
  • 10
6
votes
2 answers

Format captions in kableExtra()

Is it possible to format captions in kableExtra? I would like to center and bold a caption for a table when knitting to HTML in RMarkdown. I have tried to wrap the table in a CSS div where the text was centered, but this did not produce the intended…
Bjørn Kallerud
  • 979
  • 8
  • 23
6
votes
1 answer

R markdown: download a html table to an excel file

I have a R markdown where I built a table and I want to add the option to download the table to a excel file. kable(MyTable) %>% kable_styling(bootstrap_options = c("striped", "hover", "condensed", "responsive")) %>% scroll_box(width =…
JuanFerrer
  • 63
  • 1
  • 4
6
votes
2 answers

knitr changes (1) to
    when rendering html?

The following content of a .Rmd file: --- title: "Untitled" output: html_document: default --- ```{r cars} mtcars$am <- sprintf("(%s)", as.character(mtcars$am)) knitr::kable(mtcars, format = "html") ``` Will show ordered lists
Jozef
  • 2,617
  • 14
  • 19
6
votes
2 answers

rmarkdown & kable/kableextra: Printing % symbol in Table when using escape = F

I want to create a table in a pdf-document using rmarkdwon and kable. In the header there has to be a linebreak, so to do so i need to set escape = F. The table itself contains percent-values as strings including the % symbol (for example: "13%").…
TinglTanglBob
  • 627
  • 1
  • 4
  • 14
1 2
3
52 53