| get_vars | R Documentation |
Get used vars in a ggplot object
get_vars(p, reverse = FALSE, verbose = TRUE)
p |
A |
reverse |
Whether to return unused vars.
Default is |
verbose |
Whether to print the message.
Default is |
A character vector of variable names.
If reverse is FALSE, returns used variables;
if TRUE, returns unused variables.
library(ggplot2)
p <- ggplot(
data = mtcars,
aes(x = mpg, y = wt, colour = cyl)
) +
geom_point()
get_vars(p)
get_vars(p, reverse = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.