-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Description
It seems that the {mapproj} package is required for coord_map()
to work. The documentation for the function does talk about {mapproj} but doesn't explicitly say that the package is required.
Using the example from the function documentation this is what I get:
library(ggplot2)
library(maps)
nzmap <- ggplot(map_data("nz"), aes(x = long, y = lat, group = group)) +
geom_polygon(fill = "white", colour = "black")
nzmap + coord_map()
Error in loadNamespace(name) : there is no package called ‘mapproj‘
When running this function in isolation it's easy enough to understand I need to install the package. However when this is part of a large codebase that runs on one machine and then is attempted to run on another machine, the error has no indication of where it came from. When uploading a shiny app to shinyapps.io, shinyapps did not pick up that it needs to install {mapproj}, and looking at the error log did not make it clear where in my app {mapproj} is needed.