Closed
Description
In ggsave()
, if device
is specified and the device takes the file
argument instead of filename
, ggsave fails with an error: unused argument (filename = filename)
library(ggplot)
p <- qplot(cars[[1]], cars[[2]])
ggsave("plot.pdf", p, device = pdf)
For the grDevices
devices that take file
, ggsave customizes the call to use file
instead, but this doesn't work for devices from other packages, such as devEMF::emf
or Cairo::CairoSVG
.
This appears to be caused by these changes to remove partial argument matching.
#2355
#2364
It would be nice if ggsave automatically caught this error, then retried with file
instead of filename
.
Metadata
Metadata
Assignees
Labels
No labels