aes_string {ggplot2} | R Documentation |
Aesthetic mappings describe how variables in the data are mapped to visual properties (aesthetics) of geoms. Compared to aes this function operates on strings rather than expressions.
aes_string(...)
... |
List of name value pairs |
aes_string
is particularly useful when writing
functions that create plots because you can use strings
to define the aesthetic mappings, rather than having to
mess around with expressions.
aes_string(x = "mpg", y = "wt") aes(x = mpg, y = wt)