759 questions
4
votes
2
answers
113
views
kable_minimal() giving stripes in Quarto table HTML output
I have a Quarto doc rendering to HTML written in R and I would like a table without stripes. All of the kableExtra tables give me stripes. How do I get rid of the stripes?
---
title: "Test"
...
1
vote
2
answers
103
views
Remove column name row in kable while using kable_styling
I'm trying to make a table without row names using kable, and I'm having an issue suppressing the line where column names go, but only if I'm using kable_styling (which I'm using to left-align the ...
3
votes
1
answer
126
views
How to remove automatic table labels when using kable and bookdown for HTML
I am creating a bookdown project which includes kable tables. The final output is HTML. However, I do not want the automatic "Table 1:" labels and instead want only my custom caption I ...
1
vote
1
answer
77
views
R Markdown latex/pdf output conditional formatting with kableExtra outputting latex commands without evaluating them
Hard to come up with a handy short title for this question, sorry.
Background and Goal
I'm working on a PDF report using RMarkdown, and have need to conditionally format one of my tables. I've managed ...
0
votes
0
answers
86
views
How to style a kableExtra when printed with latex
The example below works well and prints the table as expected as a plain kable, however, if I add kable_styling(latex_options = "striped") it crashes. See code below:
---
title: "Table ...
1
vote
1
answer
96
views
How to align two tables side by side
I can't quite align two tables side by side on Rmarkdown pdf. How can I resolve this?
Code below:
---
title: "Caption"
output: pdf_document
params:
runs:
- Late
...
1
vote
1
answer
180
views
How to print headers on every page when printing a long table using gt
Trying to print a long table that span multiple pages using gt, however, the tab_options(latex.use_longtable = TRUE, page.header.use_tbl_headings = TRUE) function in gt is being ignored and it does ...
0
votes
1
answer
58
views
How to caption a kableExtra kbl dynamically from parameterized Rmarkdown file
I am having problems with captioning a kableExtra kable. I am trying to pass the yaml parameters to the kbl caption. It works fine when I only have one parameter (year) but it makes a double caption ...
1
vote
1
answer
54
views
How do I label "Averages" row without wrecking my kable()?
I've got a table I'm fairly happy with. I've added a row of column averages, and I'd like add the word "Averages" to the left of it. I've tried adding a column (labeled "") but to ...
2
votes
2
answers
106
views
Print emoji faces in R dataframe to KableExtra PDF/Latex instead of text
i have a data frame in R that looks like this :
# Sample data
df <- data.frame(
Name = c("John", "Jane", "Alice"),
Q1 = c("happy", "sad", "...
1
vote
0
answers
45
views
Why is the footer width limited by the width of the first column in kableExtra? [duplicate]
I am rendering a kable in Quarto, but the footnote seems to follow the width of the first column, which leads to two issues:
The first column becomes unnecessarily wide, and
The footnote gets broken ...
1
vote
1
answer
89
views
Borders do not display in a conditional formatted KableExtra longtable
I have a Rmarkdown file with Yaml section :
---
geometry: top=2cm , bottom= 2.5cm , left=0.5cm, right=0.5cm
output:
pdf_document:
latex_engine: xelatex
---
setup r chunk :
```{r setup, include=...
1
vote
1
answer
112
views
Wrap text for collapse rows in KableExtra for a long table in R
I have a Rmarkdown file with Yaml section :
---
geometry: top=2cm , bottom= 2.5cm , left=0.5cm, right=0.5cm
output:
pdf_document:
latex_engine: xelatex
---
setup r chunk :
```{r setup, include=...
-1
votes
1
answer
109
views
Conditional coloring and outer borders in pdf KableExtra table in R
i have a simulated data frame in R that i want to conditional format the background of the cells (ie if the value is less than 30 to be red if is between 31 and 75 to be blue and 76 and above green). ...
1
vote
1
answer
122
views
kableExtra adds   in model names
I am trying to set a modelsummary table for a github page, but as soon as I add a number to the Model name, the column head contains a random . This is the code in an MWE:
library(...
1
vote
1
answer
78
views
kableExtra html table: pack_rows() ignores
I am rendering an html document in Quarto (engine: knitr). I have added some trailing whitespaces in a kableExtra table using " ". However, as soon as I add pack_rows() to the mix, &...
1
vote
1
answer
115
views
Why is MathJax not rendered within my kableExtra table in a Quarto document?
I'm trying to generate properly a table with variable and associated p-value with kable package in a quarto document.
I use kable and kableExtra packages.
My yaml header is the following one:
---
...
3
votes
3
answers
189
views
Conditional color formatting (like Microsoft Excel) in R?
I have this object in R:
z = structure(list(year_1 = c(2000L, 2000L, 2000L, 2000L, 2000L,
2000L, 2000L, 2000L, 2000L, 2000L, 2000L, 2000L, 2000L, 2000L,
2000L, 2000L, 2000L, 2000L, 2000L, 2000L, ...
0
votes
1
answer
160
views
ggplot and table side by side in RMarkdown
I am generating a ggplot figure and a table side-by-side in RMarkdown. It needs to work
in html and pdf output. I have found a 'hacky' way of achieving this for html with inline css, but it does not ...
0
votes
2
answers
92
views
Problem with formatting table with LaTex format
I have a table with squirrel sightings, where I have species, year, total abundance and mean_abundance, like below:
library(tibble)
set.seed(42)
abundance_sum <- tibble(
Species = sample(c(&...
0
votes
1
answer
99
views
modelsummary wrapping notes in \num{} for kableExtra
When modelsummary produces a table for output type kableExtra, it wraps numbers in the notes in \num{} tags, which show up in my PDF output. I want to disable this behaviour, or know how to properly ...
1
vote
1
answer
42
views
Place a table of knitr at the top of the next page of pdf while using longtable=T
I want to place a table using table1() function with knitr()and because the table has long rows, I am using longtable=T within kable(). Because I'm using longtable=T, the table starts right after the ...
0
votes
0
answers
68
views
Printing multiples table and plots side by side with multicol in PDF Knit loop
I’m working on an R Markdown project and I’m having trouble getting my plots to show up where I want them in the document.
I need to create a loop that prints 3 tables (using kableExtra) and 3 plots (...
3
votes
1
answer
182
views
Updating to Quarto v1.6.4 now misplaces kableExtra tables
I had Quarto around v1.2 and I just updated it to v1.6.4.
Before updating I had a PDF document which gave me no hardships with regards to placement of the tables.
My minimal working example is here:
--...
0
votes
0
answers
32
views
How to crop pdf while knitting rmd
I'm trying to generate a PDF table using kableExtra in R Markdown where the output PDF dimensions exactly match the table dimensions (no extra white space, no extra text, no page number, nothing else)....
0
votes
1
answer
114
views
General approach to line wrapping in R markdown tables
When including a table in a Rmarkdown document, I would like to enable automated line wrapping for tables that are wider than the page.
There are some questions facing similar issues, like here, here, ...
0
votes
1
answer
309
views
Use kableExtra to manipulate and save tex file after modelsummary
My workflow is R + Overleaf. So often times I need to generate a regression table in R and print it out in overleaf. I recently came across the modelsummary package, which is super handy and powerful ...
0
votes
1
answer
45
views
kableExtra::add_header_above leaves empty header cells unstyled
I'm using the kableExtra package in R to create a table with styled headers, but I’m having trouble applying the same background color to header cells that are blank. When I use add_header_above with ...
0
votes
1
answer
208
views
Repeating grouped headers across pages in kableExtra
I'm putting together an R markdown document to render a pdf, which includes a long table that spans multiple pages. In that table, some of the columns are grouped, and I'm adding headers above to ...
1
vote
0
answers
56
views
The HTML data frame in R in sendmailR package body mail [duplicate]
I want to send a dataframe from R to an email address, but I want to show it with kableextra package with scroll box because it is a big dataframe. Is this possible? I can send the dataframe as an ...
1
vote
1
answer
125
views
gtsummary superscripts/footnotes with kableextra
I'm trying to display gtsummary output using kableExtra. The issue is that the superscripts corresponding to footnotes disappear when I feed to as_kable_extra
Example:
---
title: "Kable Test"...
5
votes
1
answer
88
views
collapse_rows removes topmost entry
When using kableExtra::collapse_rows with valign="top", the function seems to remove the top entry (see reprex below, the Species entry for "Setosa" is missing). When I open the ...
2
votes
2
answers
435
views
Post-process Modelsummary output with kableExtra with latex_tabular
I'm trying to produce a table with modelsummary that has spanning headers. That's why I want to post-process the modelsummary output with kableExtra::add_header_above. Also, I want the resulting table ...
2
votes
1
answer
328
views
Error using save_kable when using library kableextra to create a table in R Quarto
I would like to save a table generated with kableExtra as a PNG file in a quarto report.
I'm using the example provided in the help file of save_kable
kable(mtcars[1:5, ], "html") %>%
...
0
votes
0
answers
131
views
R kabelextra error while saving table as png or pdf
Trying to save a table I generated with kable as a png or pdf file. Using the example code in the documentation for save_kable
kable_styling("striped") %>%
row_spec(1, color = "...
1
vote
1
answer
216
views
Adjusting background color opacity in row_spec
I'm trying to adjust the opacity of the background color using kableExtra::row_spec but it seems that the part governing the alpha is being ignored. Is there anyway that I can control the alpha of a ...
0
votes
1
answer
77
views
Conditional Formatting of multiple columns with kableExtra
I want to typeset NA values in my table in italic using kableExtra. It is easy enough to do so with one column:
library(dplyr)
library(kableExtra)
## Randomly assign NAs
d <- mtcars[1:5, ]
...
3
votes
1
answer
427
views
kable_styling overrides linesep = "" and adds space every 5 rows
This is partially related to this post, but for some reason I seem not to be able to fix my issue. In Quarto, when I create a table using kable with booktabs = TRUE and linesep = "" I get ...
0
votes
1
answer
273
views
Export latex code from modelsummary using kableExtra
I am trying to get the latex code from a table that I create with modelsummary and then edit with kableExtra. I know this used to work in the past, but the newer version of modelsummary does not seem ...
1
vote
2
answers
146
views
Adding tooltips or popovers to table generated with `kableExtra` in an R quarto document
I want to add tooltips or popovers to HTML tables in Quarto, but got stuck, after reading the documentation and considerable trial and error. Links work as expected, but tooltips or popover messages ...
0
votes
1
answer
76
views
kableExtra is turning embedded html into escaped text
I am creating a html page in knitr. However, kableExtra is turning embedded html into escaped text.
Here is a MWE for the issue.
---
title: "Animals"
output:
html_document:
toc: TRUE
...
0
votes
1
answer
52
views
Multi-Column Conditional Highlighting with KableExtra and ifelse statement
Solution Below
Original Question: I am attempting to highlight the text of a KableExtra table to indicate where group observations increase or decrease by year. However, I am receiving an error about ...
0
votes
0
answers
35
views
kableExtra not recognizing qwrap2 styling
I recently updated my R and Rstudio, and now kable doesn't seem to recognizing styling from qwraps2. Here's a reproducible example with the output I get in Viewer.
options(qwraps2_markup = "...
1
vote
1
answer
45
views
force collapse_rows to not collapse rows in certain places
I am using collapse_rows() from the kableExtra package and it works a treat, and as expected.
But I would like some rows to not collapse in various situations.
Take this table, for instance:
library(...
1
vote
0
answers
352
views
R quarto kableExtra row background color
I'm making a Quarto HTML document, and I would like to change the background colors in table rows. I'm using kableExtra, and the rows are colored as I expect when I run an individual code chunk in ...
0
votes
0
answers
98
views
How can I repeat first row and first column of a table in LaTeX output in Quarto in R?
I am using Quarto in R to prepare a LaTeX/PDF output. In this document, I have a table, which is quite wide and long (13 columns and 70 rows). The first row contains the column names, and the first ...
5
votes
1
answer
705
views
R kableExtra adds additional empty row when inserting horizontal line
I am creating a Latex table using the kableExtra package in R. I want to insert a horizontal line after a certain row, however, this also automatically adds an empty row. How can this behavior be ...
0
votes
1
answer
105
views
Was there a `datasummary::modelsummary` update that made it glitchy with `kableExtra`?
I am using the following code to create a latex table using modelsummary and kableExtra. The code used to work but it seems that either modelsummary or kableExtra made some changes that made it harder ...
0
votes
0
answers
46
views
Collpase_rows middle alignment not working properly
I'm trying to generate a nice table using Rmarkdown to export in pdf, to do so I'm using kable and its formatting options and the function collpase_rows to merge some cells.
Here it's the problem, I'm ...
2
votes
1
answer
396
views
"Argument is of length zero" from kableExtra after updating Rstudio
After I updated Rstudio some code that had previously worked fine now throws an error. I've confirmed that this isn't due to the nature of my data by using mtcars for the same thing and getting the ...