On Thu, Apr 22, 2021 at 11:19 PM Kevin R. Coombes <[email protected]> wrote: [...] > Instead, the vignette says you should > importFrom("rlang", ".data") > in your NAMESPACE, and write > ggplot(myData, aes(x = .data$myX, y = .data$myY)) > > And now my dinosaur question: That looks like using one non-standard > hack to cover up the problems with another non-standard hack. Why the > heck is that any better for the developer than writing > ggplot(myData, aes(x = myData$myX, y = myData$myY))
Well, for one, because it does not always work, see e.g. the examples and links here: https://github.com/tidyverse/ggplot2/issues/2693 > or using Dirk Eddelbuettel's suggestion of calling utils::globalVariables ?? Because if you refer to a hundred different columns in your plots, then you'll need to add all of them to globalVariables(), and this is error prone and cumbersome to update. If you only refer a handful of columns, then sure, this will work as well. Gabor [...] ______________________________________________ [email protected] mailing list https://stat.ethz.ch/mailman/listinfo/r-package-devel
