Description Usage Arguments Value Examples
Build aesthetics to use in a plot
1 |
data |
Data to use in the plot. |
... |
Named list of aesthetics. |
.list |
Alternative to |
geom |
Geom to use, according to the geom aesthetics may vary. |
An expression
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | # Classic
build_aes(iris, x = "Sepal.Width")
build_aes(iris, x = "Sepal.Width", y = "Sepal.Width")
# Explicit geom : no change
build_aes(iris, x = "Species", geom = "bar")
# Little trick if data is count data
df <- data.frame(
LET = c("A", "B"),
VAL = c(4, 7)
)
build_aes(df, x = "LET", y = "VAL", geom = "bar")
# e.g. :
library(ggplot2)
ggplot(df) +
build_aes(df, x = "LET", y = "VAL", geom = "bar") +
geom_bar()
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.