2

I can't seem to figure out how to save the gtsummary tbl_summary and tbl_regression tables as tiffs. The code saves it in the right place and produces a tiff file, but when I open the file it is just a white, blank screen. Here's the code:

tiff(filename = "C:\\Users\\name\\Desktop\\folder\\tiff300.tiff", 
     width = 5, height = 5, units = "in", res = 700)
    multinom(group ~ time, data = dataset) %>%
    tbl_regression(exponentiate = TRUE,pvalue_fun = ~style_pvalue(.x, digits = 3)) %>%
    modify_header(label = "**Variable**") %>%
    bold_labels() %>%
    bold_p(t = 0.05) %>%
    modify_caption("**Table 3. Multinomial Regression**")
dev.off()
Andrew Gustar
  • 17,295
  • 1
  • 22
  • 32
joycie
  • 21
  • 1
  • Does it need to be tiff format? Here's a post in saving the tables as images https://stackoverflow.com/questions/60751172/how-to-output-gtsummary-tables-as-images?r=SearchResults – Daniel D. Sjoberg Jul 14 '21 at 15:08
  • Yes, ideally it would be a tiff format, since the other formats don't offer as much resolution. – joycie Jul 16 '21 at 16:15
  • I did some poking around, and I didn't see anything about saving to tiff. gtsummary tables can be converted to gt, flextable, huxtable, kableExtra, and kable tables. Perhaps looking for one of those output formats will yield what you're looking for. Good Luck! – Daniel D. Sjoberg Jul 20 '21 at 12:01

0 Answers0