My Rmarkdown doesn't recognize the _ in kable_styling when I run the Knit to compile the Pdf or Html.
I've updated the packages(including tinytex and pandoc) as recommended at Yuhui Tinytex Debbuging and also tried to compile in different R versions (3.6.3 and 4.0.4 - 64 bits ).
Also, I tried installing the package ghostcript, but didn't find a version that matches any of my R versions.
This is the message from the error
I was unable to find any missing LaTeX packages from the error log projeto1v2.log.
! Missing $ inserted.
<inserted text>
$
l.227 kable_
styling(full_width = FALSE,latex_options = "hold_position", ro...
Try to find the following text in projeto1v2.Rmd:
kable_
You may need to add $ $ around a certain inline R expression ´r ´ in projeto1v2.Rmd (see the above
hint). See https://github.com/rstudio/rmarkdown/issues/385 for more info.
Erro: LaTeX failed to compile projeto1v2.tex. See https://yihui.org/tinytex/r/#debugging for
debugging tips. See projeto1v2.log for more info.
Além disso: Warning message:
In has_crop_tools() :
Tool(s) not installed or not in PATH: ghostcript
-> As a result, figure cropping will be disabled.
Execução interrompida
A reproducible example:
library(kableExtra)
winelist <- data.frame(dados[1:12])
sumario <- round(sapply(dados, summary),2)
sumario <- t(sumario)
tabela1 <- data.frame(histograma="", sumario)
tabela1 %>%
kable(booktabs = TRUE) %>%
kable_styling(full_width = FALSE,latex_options = "hold_position",
row_label_position='c',
position='center') %>%
kable_paper(full_width = FALSE) %>%
column_spec(4, image = spec_hist(winelist))
The Dataset it's from Kaggle: Red Wine Quality
Someone know how to correct this error?