Skip to contents

[Experimental] Constructor of ggplot2_args class of objects. The ggplot2_args argument should be a part of every module which contains any ggplot2 graphics. The function arguments are validated to match their ggplot2 equivalents.

For more details see the vignette: vignette("custom-ggplot2-arguments", package = "teal.widgets").

Usage

ggplot2_args(labs = list(), theme = list())

Arguments

labs

(named list)
where all fields have to match ggplot2::labs() arguments.

theme

(named list)
where all fields have to match ggplot2::theme() arguments.

Value

(ggplot2_args) object.

See also

Examples

ggplot2_args(
  lab = list(title = "TITLE"),
  theme = list(title = ggplot2::element_text(size = 20))
)
#> $labs
#> $labs$title
#> [1] "TITLE"
#> 
#> 
#> $theme
#> $theme$title
#> List of 11
#>  $ family       : NULL
#>  $ face         : NULL
#>  $ colour       : NULL
#>  $ size         : num 20
#>  $ hjust        : NULL
#>  $ vjust        : NULL
#>  $ angle        : NULL
#>  $ lineheight   : NULL
#>  $ margin       : NULL
#>  $ debug        : NULL
#>  $ inherit.blank: logi FALSE
#>  - attr(*, "class")= chr [1:2] "element_text" "element"
#> 
#> 
#> attr(,"class")
#> [1] "ggplot2_args"