Skip to content

unused arguments with svg device when knitting  #484

@cderv

Description

@cderv

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:

gganimate/R/animate.R

Lines 305 to 306 in 7cd46dc

for (i in seq_along(frames)) {
if (!stream) device(files[i], ...)

Basically some options are passed to svg() device function and they are not argument of grDevices::svg()

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions