prioritizr / aoh

Create Area of Habitat Data
https://prioritizr.github.io/aoh
9 stars 1 forks source link

error in plot_spp_data #24

Closed ctelhado closed 2 years ago

ctelhado commented 2 years ago

https://github.com/prioritizr/aoh/blob/c875d2b2de8110474105e950cdbace27bdd893f0/vignettes/aoh.Rmd#L162

Got the following error after the code to create 'map' "Error in plot_spp_data(x = x, max_plot = max_plot, expand = expand, zoom = zoom, : the "ggmap" package must be installed to include a basemap"

ctelhado commented 2 years ago

Obs: loading ggmap package does solve the issue.

jeffreyhanson commented 2 years ago

Thanks for raising this! Yeah, the package has some optional dependencies (e.g. gdalUtilities and ggmap). This means that certain packages might need to be installed to use certain functions or complete certain tasks (e.g., the ggmap package is required to show a basemap). Do you have any suggestions for improving the error message to better explain this? E.g., what about please install the "ggmap" package to create plots with a basemap?

jeffreyhanson commented 2 years ago

I could also add some text to the vignette explaining that the ggmap R package might need to be installed?

ctelhado commented 2 years ago

Yeah, I think adding a line in the vignette would make this clear (just explaining that the example is using it but not essential to the package). And error message you suggested is spot on!

jeffreyhanson commented 2 years ago

Ok brilliant - thanks!