A brief word about sanitizing table contents.
cols_extra
x <- ptdata() %>% st_new(notes = "EDA_summary = TRUE") %>% st_make(inspect = TRUE) %>% get_stable_data() x$notes
[1] "EDA\\_summary = TRUE"
x <- ptdata() %>% st_new() %>% st_files(r = "my_script.R") %>% st_make(inspect = TRUE) %>% get_stable_data() x$notes
[1] "Source code: my\\_script.R"
out <- tibble(a_1 = 5) %>% stable(inspect = TRUE) %>% get_stable_data() out$cols_tex
[1] "a\\_1 \\\\"
out <- tibble(a = "5_2") %>% stable(inspect = TRUE) %>% get_stable_data() out$tab
[1] "5\\_2 \\\\"
out <- ptdata() %>% stable( inspect = TRUE, span = colgroup("foo_this", WT:SCR) ) %>% get_stable_data() out$span_data$tex
[1] "\\multicolumn{4}{c}{} & \\multicolumn{5}{c}{foo\\_this} \\\\" [2] "\\cmidrule(lr){5-9}"
data <- tibble( a = c("a_1", "a_1", "a_1", "a_2", "a_2"), b = letters[1:5] ) out <- stable(data, panel = "a") out[grepl("multicolumn", out)]
[1] "\\multicolumn{1}{l}{\\textbf{a\\_1}}\\\\%--pmtables-insert-panel" [2] "\\hline \\multicolumn{1}{l}{\\textbf{a\\_2}}\\\\%--pmtables-insert-panel"
x <- letters[1:5] data <- tibble(a = x, b = x, c = x) xtra <- tibble(a = "foo%", b = "$\\mu$g", c = "1234 \\% %") out <- stable(data, cols_extra = xtra) out[grepl("%", out, fixed = TRUE)]
[1] "foo\\% & $\\mu$g & 1234 \\% % \\\\"