Quantcast
Viewing latest article 5
Browse Latest Browse All 106

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 = "markdown")summary_statistics <-  list("Sepal Length" =      list("N (%)" = ~qwraps2::n_perc0(!is.na(Sepal.Length), na_rm = TRUE),"Mean (SD)" = ~paste0(round(mean(Sepal.Length, na.rm = T), 1), ' (',                               round(sd(Sepal.Length, na.rm = T), 1), ')')      ),"Sepal Width" =      list("N (%)" = ~qwraps2::n_perc0(!is.na(Sepal.Width), na_rm = TRUE),"Mean (SD)" = ~paste0(round(mean(Sepal.Width, na.rm = T), 1), ' (',                               round(sd(Sepal.Width, na.rm = T), 1), ')')      )  )tbl <- summary_table(iris, summary_statistics, by = 'Species')colnames(tbl) <- gsub('\\(', '\\<br\\/\\>\\(', colnames(tbl))kable(tbl, col.names = colnames(tbl), escape = F) %>%  kable_styling() %>%  pack_rows('Sepal Length', 1, 2) %>%  pack_rows('Sepal Width', 3, 4)

Image may be NSFW.
Clik here to view.
enter image description here

UPDATE: Styling issue is fixed by using kbl(). However, is there an option so that the header row for each section is not repeated from summary_statistics and pack_rows? Would like to keep the header rows from pack_rows instead.

Image may be NSFW.
Clik here to view.
enter image description here


Viewing latest article 5
Browse Latest Browse All 106

Trending Articles



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