Closed
Description
Trying to save a plot to svg without svsglite installed (which is possible because svglite is a Suggest) throws this error:
> ggsave("poster.svg")
Saving 7 x 7 in imageError in loadNamespace(x) : there is no package called ‘svglite’
The error is not very helpful as it doesn't tell the user what the issue is and how to resolve it.
The problem is that plot_dev
doesn't check if svglite is installed here:
Line 280 in b174986
so R errors out when trying to evaluate the dev
function; probably here:
Line 109 in b174986
Maybe a better alternative would be to do something like this:
svg = function(filename, ...) {
check_installed("svglite", reason = "to save as SVG.")
svglite::svglite(file = filename, ...)
}