I'm writing a package and one of my functions generates a ggplot. I would like to only import ggplot2 or rlang (without depending on them). After some trial and error I managed to get it to work, but now I'm not sure why it works.
So my question is, why does the following code work without directly accessing !! with ::?
arg1 <- "Species"
ggplot2::ggplot(iris, ggplot2::aes(x = Petal.Width, y = !!rlang::sym(arg1))) +
ggplot2::geom_bar(stat = "summary", fun = "max")
My understanding is that in order to access the !! function I should have to specify the package with ::, but this example works so what am I missing?