-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Closed
Labels
messagesrequests for improvements to error, warning, or feedback messagesrequests for improvements to error, warning, or feedback messages
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
svg = function(filename, ...) svglite::svglite(file = filename, ...), |
so R errors out when trying to evaluate the dev
function; probably here:
Line 109 in b174986
dev(filename = filename, width = dim[1], height = dim[2], bg = bg, ...) |
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, ...)
}
Metadata
Metadata
Assignees
Labels
messagesrequests for improvements to error, warning, or feedback messagesrequests for improvements to error, warning, or feedback messages