Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

geom_exec

Execute ggplot2 functions


Description

A helper function used by ggpubr functions to execute any geom_* functions in ggplot2. Useful only when you want to call a geom_* function without carrying about the arguments to put in aes(). Basic users of ggpubr don't need this function.

Usage

geom_exec(geomfunc = NULL, data = NULL, position = NULL, ...)

Arguments

geomfunc

a ggplot2 function (e.g.: geom_point)

data

a data frame to be used for mapping

position

Position adjustment, either as a string, or the result of a call to a position adjustment function.

...

arguments accepted by the function

Value

return a plot if geomfunc!=Null or a list(option, mapping) if geomfunc = NULL.

Examples

## Not run: 
ggplot() + geom_exec(geom_point, data = mtcars,
    x = "mpg", y = "wt", size = "cyl", color = "cyl")

## End(Not run)

ggpubr

'ggplot2' Based Publication Ready Plots

v0.4.0
GPL-2
Authors
Alboukadel Kassambara [aut, cre]
Initial release
2020-06-27

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.