mikeroswell / ratioScales

Development of ratio scales package for plotting
https://mikeroswell.github.io/ratioScales/
1 stars 1 forks source link

Clever dependencies (e.g., ggplot2) #16

Closed mikeroswell closed 11 months ago

mikeroswell commented 11 months ago

Looks like right now if I run library(ratioScales) followed by mtcars %>% ggplot(aes(cyl, mpg)) + geom_point() + theme_classic() I get Error in ggplot(., aes(cyl, mpg)) : could not find function "ggplot". Is there any reason it should be possible to load ratioScales without ggplot2? If so, justify. If not, automatically load ggplot2?

bbolker commented 11 months ago

Makes sense to me to use a Depends: dependency in this case ...?

mikeroswell commented 11 months ago

I think so! This issue was a note to read/think about that but I'll take this as an endorsement/starting point.

mikeroswell commented 11 months ago

Based on https://stackoverflow.com/a/39556558/8400969, was able to get dependency fully there by not only adding ggplot2 to Depends in DESCRIPTION but also adding an @imports ggplot2 to roxygen comment for first function in ratioScales.R