A workaround would be to use the DT
package. This renders an HTML table, but depending on your needs you could use this one. In RStudio
you can also easily export the table to any picture format:
library(DT)
dat <- data.frame(CANDIDATE = c("Biden", "Sanders", "Gabbard", "O'Rourke",
"Warren", "Yang", "Buttigieg", "Castro",
"Harris", "Klobuchar", "Booker", "Steyer"),
EXCLUSIVE = c(218, 100, 11, 29, 107, 14, 27, 6, 23, 8, 4, 1),
TOTAL = c(996, 683, 83, 245, 917, 187, 437, 105, 433, 180, 201, 84),
SHARE = c(21.9, 14.6, 13.1, 11.7, 11.6, 7.4, 6.2,
5.7, 5.2, 4.2, 2.2, 1.4) / 100)
datatable(dat, options = list(
columnDefs = list(list(className = "dt-left", targets = 4)))) %>%
formatPercentage("SHARE", 1) %>%
formatStyle("SHARE",
background = styleColorBar(dat$SHARE, "steelblue", -90), backgroundPosition = "left")
