Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

After updating gt, cant save to .png #1943

Closed
2 tasks done
msperlin opened this issue Jan 20, 2025 · 2 comments
Closed
2 tasks done

After updating gt, cant save to .png #1943

msperlin opened this issue Jan 20, 2025 · 2 comments
Assignees

Comments

@msperlin
Copy link

msperlin commented Jan 20, 2025

Prework

Description

Can't save a table to .png.

I'm using latest R, and updated all packages from CRAN. I'm working on linux Mint.

Reproducible example

df <- tibble::tibble(
  x = 1:10,
  y = x + 1
)

df |> 
  gt::gt() |>
  gt::gtsave("~/tbl-fig.png")

The error:

Image

Expected result

It should have saved my table in .png.

Session info

reprex(session_info = TRUE)`)
#> Error in parse(text = input): <text>:1:28: unexpected INCOMPLETE_STRING
#> 1: reprex(session_info = TRUE)`)
#>                                ^

Created on 2025-01-20 with reprex v2.1.1

Session info
sessioninfo::session_info()
#> ─ Session info ───────────────────────────────────────────────────────────────
#>  setting  value
#>  version  R version 4.4.2 (2024-10-31)
#>  os       Linux Mint 22
#>  system   x86_64, linux-gnu
#>  ui       X11
#>  language en_US
#>  collate  en_US.UTF-8
#>  ctype    en_US.UTF-8
#>  tz       America/Sao_Paulo
#>  date     2025-01-20
#>  pandoc   3.2 @ /usr/lib/rstudio/resources/app/bin/quarto/bin/tools/x86_64/ (via rmarkdown)
#> 
#> ─ Packages ───────────────────────────────────────────────────────────────────
#>  package     * version date (UTC) lib source
#>  cli           3.6.3   2024-06-21 [1] CRAN (R 4.4.1)
#>  digest        0.6.37  2024-08-19 [1] CRAN (R 4.4.1)
#>  evaluate      1.0.3   2025-01-10 [1] CRAN (R 4.4.2)
#>  fastmap       1.2.0   2024-05-15 [1] CRAN (R 4.4.1)
#>  fs            1.6.5   2024-10-30 [1] CRAN (R 4.4.1)
#>  glue          1.8.0   2024-09-30 [1] CRAN (R 4.4.1)
#>  htmltools     0.5.8.1 2024-04-04 [1] CRAN (R 4.4.1)
#>  knitr         1.49    2024-11-08 [1] CRAN (R 4.4.2)
#>  lifecycle     1.0.4   2023-11-07 [1] CRAN (R 4.4.1)
#>  reprex        2.1.1   2024-07-06 [1] CRAN (R 4.4.1)
#>  rlang         1.1.5   2025-01-17 [1] CRAN (R 4.4.2)
#>  rmarkdown     2.29    2024-11-04 [1] CRAN (R 4.4.2)
#>  rstudioapi    0.17.1  2024-10-22 [1] CRAN (R 4.4.1)
#>  sessioninfo   1.2.2   2021-12-06 [1] CRAN (R 4.4.1)
#>  withr         3.0.2   2024-10-28 [1] CRAN (R 4.4.1)
#>  xfun          0.50    2025-01-07 [1] CRAN (R 4.4.2)
#>  yaml          2.3.10  2024-07-26 [1] CRAN (R 4.4.1)
#> 
#>  [1] /home/msperlin/R/x86_64-pc-linux-gnu-library/4.4
#>  [2] /usr/local/lib/R/site-library
#>  [3] /usr/lib/R/site-library
#>  [4] /usr/lib/R/library
#> 
#> ──────────────────────────────────────────────────────────────────────────────
@olivroy
Copy link
Collaborator

olivroy commented Jan 20, 2025

This is possibly due to the choromote package. Make sure chromote is >= 0.3.1. See rstudio/chromote#187 (comment) for a workaround. The next chromote update will probably fix this natively.

@msperlin
Copy link
Author

Thanks. I just added options(chromote.headless = "new") and it solved the issue.

best,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants