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

RMarkdown Formattable Styling From kableExtra renders html code - not formatted value

$
0
0

When using kableExtra's cell_spec function, I cannot get the rmd document to format the target cell correctly. I can see the html format being applied, but it is rendering the html code itself, not the formatted value. I'm trying to format the p-value of a simple summary stats output.

What ends up rendered in the .html file is below:rendered-table

I'm doing the same thing as below but with my own real data. For reference, this chunk produces the same problem.

mtcars %>%   rownames_to_column('car') %>%   select(car, mpg, disp, hp, wt) %>%   mutate(wt = ifelse(wt < 2,                      kableExtra::cell_spec(wt, color = 'red', bold = TRUE),                      wt)) %>%   kableExtra::kable() %>%   kableExtra::kable_styling()

Viewing all articles
Browse latest Browse all 105

Trending Articles



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