Closed kidwellj closed 4 months ago
ggplot() is basically always running slow when using the default graphics device on MacOS, which becomes more painfully evident when plotting geospatial objects and others which are computationally complex. This is easily resolved (as per this thread on quarto) To resolve this, you simply need to add a block to _quarto.yml:
knitr:
opts_chunk:
dev: ragg_png
However I wonder if it would be prudent to simply change the default graphics device in knitr
as this has already been done in ggplot
(noted here.
Thanks for opening the issue!
Just adding that with R Markdown, the default graphic device is defined in the output format. It can be changed with dev
option in YAML.
Example for html_document
Same for Quarto where the default device is defined in the HTML format.
So even if we were to change the default in knitr, I think it requires to adapt in other tools too that may not use knitr defaults.
In all case, we probably can only change the default to ragg when the package is available, otherwise this would add a new dependency to knitr or markdown.
Thanks for the suggestion! Changing the default will affect too many users and perhaps also cause breakage (e.g., when ragg is not installed). I tend not to do it in knitr but want to let you know that you can change the default by yourself: https://yihui.org/en/2023/10/opts-chunk/
By filing an issue to this repo, I promise that
xfun::session_info('knitr')
. I have upgraded all my packages to their latest versions (e.g., R, RStudio, and R packages), and also tried the development version:remotes::install_github('yihui/knitr')
.I understand that my issue may be closed if I don't fulfill my promises.