On Thu, Apr 22, 2021 at 11:19 PM Kevin R. Coombes
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
For some reason that I don't remember, an R core member once told me
that they prefer x <- y <- NULL to utils::globalVariables(c("x","y")) -
although I have also encountered problems with that strategy in edge cases.
Here's an example from StackOverflow from today where for some reason
I do
Thanks.
Obviously, long. long ago, (in a galaxy not far enough away), Paul's
suggestion of using "aes_string" was the correct one, since "aes" uses
non-standard evaluation. (And to quote somebody from an R fortune
cookie, "The problem with non-standard evaluation is that it is
non-standard.")
On 22 April 2021 at 16:28, Kevin R. Coombes wrote:
| I'm trying to help clean up an R package for someone else to submit to
| CRAN. He has used ggplot2 to implement a plotting function for the kinds
| of things that his packages generates. His plotting routine basically
| looks like (after cha
Kevin,
This vignette from ggplot2 itself gives the "officially recommended" ways
to avoid the warnings from R CMD check
https://ggplot2.tidyverse.org/articles/ggplot2-in-packages.html
Cheers,
-Robert
On Thu, Apr 22, 2021 at 4:39 PM Paul SAVARY
wrote:
> Hi Kevin,
>
> I was faced to the same p
Hi Kevin,
I was faced to the same problem and I used 'aes_string()' instead of 'aes()'.
You can then just write the name of the columns containing the data to plot as
character strings.
Example:
myPlot <- function(myData, ...) {
# get ready
ggplot(myData, aes_string(x = "myX", y = "myY
Hi,
I'm trying to help clean up an R package for someone else to submit to
CRAN. He has used ggplot2 to implement a plotting function for the kinds
of things that his packages generates. His plotting routine basically
looks like (after changing names to protect the innocent):
myPlot <- fucnt