Quantcast
Channel: Active questions tagged kable - Stack Overflow
Viewing all articles
Browse latest Browse all 109

`caption =` argument not working in kable() R

$
0
0

I'm having trouble exporting a kable table with LaTex using save_kable() function after I add the caption = argument in kable() function.

I thought it was because I recently updated my R version, RStudio version, TeX version, and everything that could cause errors, but then I switch to R Servers (R 4.3.2 currently), which I never touched upon before. I got the same error message that says "! LaTeX Error: Something's wrong--perhaps a missing \item." If I delete the caption =, I was able to export the table in LaTex. Here is a minimum example.

library(tidyverse)library(kableExtra)library(magick)dt <- mtcars[1:5, 1:6]dt %>%  kbl("latex",caption = "Recreating booktabs style table") %>%  save_kable(file = "a.png")

Any help would be appreciated!


Viewing all articles
Browse latest Browse all 109

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>