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
12
votes
2 answers

How to make kable table reactive() in shiny app? Shiny + kable

I am trying to make kable table reactive and export it in shiny app. already gave a try with renderDataTable/renderTable inside server and output functions as datatableOutput/tableOutput, but of no luck and following is the line of code. …
Dinesh
  • 391
  • 2
  • 9
12
votes
1 answer

left- align table caption with kable or kableExtra

Is it possible to left-align the table caption? I am annoyed by the APA6th rules but I have to left-align the table caption somehow. Take for example this table: library(knitr) library(kableExtra) kable(mtcars[1:10, 1:6], format = "latex",…
Jaynes01
  • 521
  • 1
  • 5
  • 20
9
votes
1 answer

How to add more space between columns of knitr::kable() in RStudio notebooks?

I want to use function knitr::kable() in an RStudio notebook. If column names are short, the spaces between columns are small and it makes information hard to understand (see figure below). It seems that padding does not work in this situation. Is…
GegznaV
  • 4,938
  • 4
  • 23
  • 43
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
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
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
8
votes
1 answer

Table Cross-References in Bookdown with MS-Word Output?

How can I make table cross-references work in a bookdown document with all of the output formats pdf, docx, and html? Or maybe more specifically, how can I get table cross-references working for flextables? Below is a minimal working example. The…
lowndrul
  • 3,715
  • 7
  • 36
  • 54
8
votes
2 answers

Is it possible to add vertical lines to tables produced with R knitr::kable in pdf?

I want to produce a table with knitr::kable with vertical lines on the borders and between certain columns. Is there a way to do it? My output document is pdf. Thanks!
iago
  • 2,990
  • 4
  • 21
  • 27
8
votes
2 answers

Reduce spacing between columns in table created with kable(, format = 'markdown')

I try to create a table using the format "markdown" of the function kable(), but the spaces between the columns are so wide that the table extends over the page. Is there anyway to adjust the cell size so that a table in markdown format does not…
JAQuent
  • 1,137
  • 11
  • 25
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
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
1
2
3
52 53