unused arguments with svg device when knitting
cderv opened this issue · 0 comments
cderv commented
First reported at quarto-dev/quarto-cli#6643
---
title: "Label shouldn't be named"
output:
html_document:
dev: svg
---
```{r}
library(gganimate)
```
```{r}
ggplot(mtcars, aes(factor(cyl), mpg)) +
geom_boxplot() +
transition_states(gear)
```
Quitting from lines 13-16 [unnamed-chunk-2] (test.Rmd)
Error in `device()`:
! arguments inutilisés (units = "in", res = 192)
Backtrace:
1. rmarkdown::render(...)
2. knitr::knit(knit_input, knit_output, envir = envir, quiet = quiet)
3. knitr:::process_file(text, output)
7. knitr:::process_group.block(group)
8. knitr:::call_block(x)
...
19. knitr (local) value_fun(ev$value, ev$visible)
20. knitr (local) fun(x, options = options)
23. gganimate::knit_print.gganim(x, ...)
26. gganimate:::animate.gganim(...)
28. gganimate (local) `<fn>`(...)
Exécution arrêtée
We see error comes from gganimate itself. Especially here:
Lines 305 to 306 in 7cd46dc
Basically some options are passed to svg()
device function and they are not argument of grDevices::svg()
- gganimate does define a
knit_print
method : https://github.com/thomasp85/gganimate/blob/7cd46dc2bc8cf18c1c81f6ef7fc4d00a1d57a385/R/gganim.R#L36C1-L37 - It will defined some options among which
units
andres
when no width or height; Bothunits
andres
are in error messageLines 46 to 54 in 7cd46dc
- Those options will be passed up to the device used selected in
draw_frames
Lines 285 to 296 in 7cd46dc
res
and in
are not among svg()
arguments
rlang::fn_fmls_names(grDevices::svg)
#> [1] "filename" "width" "height" "pointsize" "onefile"
#> [6] "family" "bg" "antialias" "symbolfamily"
Hence the error I believe.