You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In situations when I am programming around ggplot2 to modify figures, I would like to be able to add aesthetics together.
The goal would be to allow modification of existing figures or plotting routines in a simpler way.
library(ggplot2)
aes(x=A) + aes(y=B) # equals aes(x = A, y = B)
aes(x=A, colour=D) + aes(x=C, y=B) # equals aes(x = C, y = B, colour = D)
aes(x=A) +NULL# equals aes(x = A)
I think that the above is the most useful. But, while setting up operations for aesthetics, I think that having a method to subtract could also be useful. I think that the default subtraction method should be that it removes the aesthetic:
library(ggplot2)
aes(x=A) - aes(y=B) # no change, possibly with a warning aes(x = A)
aes(x=A, colour=D) - aes(x=C, y=B) # equals aes(colour = D)
aes(x=A) -NULL# no change aes(x = A)
The text was updated successfully, but these errors were encountered:
This (or something very similar to this) has been discussed in #4789.
The outcome of that discussion was that the splicing mechanism (see #2675) is preferred over further overloading the + operator.
In situations when I am programming around
ggplot2
to modify figures, I would like to be able to add aesthetics together.The goal would be to allow modification of existing figures or plotting routines in a simpler way.
I think that the above is the most useful. But, while setting up operations for aesthetics, I think that having a method to subtract could also be useful. I think that the default subtraction method should be that it removes the aesthetic:
The text was updated successfully, but these errors were encountered: