Rendering sparklines in LaTeX in R Markdown using gtExtras

28 Views Asked by At

This code from gtExtras website:

library(gt)
gt_sparkline_tab <- mtcars %>%
    dplyr::group_by(cyl) %>%
    # must end up with list of data for each row in the input dataframe
    dplyr::summarize(mpg_data = list(mpg), .groups = "drop") %>%
    gt() %>%
    gt_plt_dist(mpg_data) %>% as_latex()
gt_sparkline_tab 

gives the following error when rendering to LaTeX:

! You can't use `macro parameter character #' in restricted horizontal mode. l.355 ... circle { fill: none; stroke: # 000000; stroke-lineca...

I can't quite figure how to bypass this.

0

There are 0 best solutions below