Title: | Simplify 'ggplot2' Visualisation |
---|---|
Description: | Simplify 'ggplot2' visualisation with 'ggblanket' wrapper functions. |
Authors: | David Hodge [aut, cre, cph]
|
Maintainer: | David Hodge <[email protected]> |
License: | MIT + file LICENSE |
Version: | 12.1.0 |
Built: | 2025-01-27 13:00:00 UTC |
Source: | CRAN |
A colour aesthetic to contrast with a fill aesthetic. Can be spliced into ggplot2::aes with rlang::!!!.
aes_colour_contrast(..., dark = "#121B24FF", light = "#FFFFFFFF")
aes_colour_contrast(..., dark = "#121B24FF", light = "#FFFFFFFF")
... |
Provided to require argument naming, support trailing commas etc. |
dark |
A dark colour. |
light |
A light colour. |
A ggplot2 aesthetic
library(ggplot2) library(dplyr) library(stringr) library(palmerpenguins) set_blanket() penguins |> count(species, sex) |> gg_col( x = sex, y = n, col = species, label = n, position = position_dodge(preserve = "single"), width = 0.75, x_labels = \(x) str_to_sentence(x), ) + geom_text( mapping = aes_colour_contrast(), position = position_dodge(width = 0.75, preserve = "single"), vjust = 1.33, show.legend = FALSE, ) penguins |> count(species, sex) |> gg_col( x = sex, y = n, col = species, position = position_dodge(preserve = "single"), width = 0.75, x_labels = \(x) str_to_sentence(x), theme = dark_mode_r(), ) + geom_text( mapping = aes(label = n, !!!aes_colour_contrast(dark = darkness[3], light = darkness[1])), position = position_dodge(width = 0.75, preserve = "single"), vjust = 1.33, show.legend = FALSE, )
library(ggplot2) library(dplyr) library(stringr) library(palmerpenguins) set_blanket() penguins |> count(species, sex) |> gg_col( x = sex, y = n, col = species, label = n, position = position_dodge(preserve = "single"), width = 0.75, x_labels = \(x) str_to_sentence(x), ) + geom_text( mapping = aes_colour_contrast(), position = position_dodge(width = 0.75, preserve = "single"), vjust = 1.33, show.legend = FALSE, ) penguins |> count(species, sex) |> gg_col( x = sex, y = n, col = species, position = position_dodge(preserve = "single"), width = 0.75, x_labels = \(x) str_to_sentence(x), theme = dark_mode_r(), ) + geom_text( mapping = aes(label = n, !!!aes_colour_contrast(dark = darkness[3], light = darkness[1])), position = position_dodge(width = 0.75, preserve = "single"), vjust = 1.33, show.legend = FALSE, )
Replace a axis line with an annotated segment, so that geom features are in front of it.
annotate_axis_line( axis = "x", ..., x_position = "bottom", y_position = "left", colour = NULL, linewidth = NULL )
annotate_axis_line( axis = "x", ..., x_position = "bottom", y_position = "left", colour = NULL, linewidth = NULL )
axis |
The axis. Either "x" or "y" |
... |
Extra parameters passed to |
x_position |
The position of the "x" axis, if applicable. Either "bottom" or "top". |
y_position |
The position of the "y" axis, if applicable. Either "left" or "right". |
colour |
The colour of the annotated segment. |
linewidth |
The linewidth of the annotated segment. |
A list of a annotate layer and theme elements.
library(dplyr) library(ggplot2) library(ggblanket) library(palmerpenguins) set_blanket() penguins |> add_row( flipper_length_mm = 175, body_mass_g = 2500, species = "Adelie", ) |> gg_blanket( x = flipper_length_mm, y = body_mass_g, col = species, ) + annotate_axis_line() + geom_point(size = 2.5)
library(dplyr) library(ggplot2) library(ggblanket) library(palmerpenguins) set_blanket() penguins |> add_row( flipper_length_mm = 175, body_mass_g = 2500, species = "Adelie", ) |> gg_blanket( x = flipper_length_mm, y = body_mass_g, col = species, ) + annotate_axis_line() + geom_point(size = 2.5)
A blue colour.
blue
blue
A character vector.
scales::show_col(blue)
scales::show_col(blue)
A dark mode family of functions:
dark_mode_r()
with legend on right
dark_mode_t()
with legend on top
dark_mode_b()
with legend on bottom
dark_mode_r( ..., base_size = 11, base_family = "", base_colour = "#C8D7DFFF", axis_line_colour = "#C8D7DFFF", axis_line_linewidth = 0.25, axis_ticks_colour = axis_line_colour, axis_ticks_linewidth = axis_line_linewidth, panel_grid_colour = "#00040AFF", panel_grid_linewidth = 1.33, panel_background_fill = "#050D1BFF", plot_background_fill = "#00040AFF", legend_axis_line_colour = plot_background_fill, legend_axis_line_linewidth = axis_line_linewidth, legend_background_fill = plot_background_fill, legend_key_fill = plot_background_fill, legend_ticks_colour = legend_axis_line_colour, legend_ticks_linewidth = legend_axis_line_linewidth, legend_ticks_length = ggplot2::rel(c(0.175, 0)) ) dark_mode_t( ..., base_size = 11, base_family = "", base_colour = "#C8D7DFFF", axis_line_colour = "#C8D7DFFF", axis_line_linewidth = 0.25, axis_ticks_colour = axis_line_colour, axis_ticks_linewidth = axis_line_linewidth, panel_grid_colour = "#00040AFF", panel_grid_linewidth = 1.33, panel_background_fill = "#050D1BFF", plot_background_fill = "#00040AFF", legend_axis_line_colour = plot_background_fill, legend_axis_line_linewidth = axis_line_linewidth, legend_background_fill = plot_background_fill, legend_key_fill = plot_background_fill, legend_ticks_colour = legend_axis_line_colour, legend_ticks_linewidth = legend_axis_line_linewidth, legend_ticks_length = ggplot2::rel(c(0.175, 0)) ) dark_mode_b( ..., base_size = 11, base_family = "", base_colour = "#C8D7DFFF", axis_line_colour = "#C8D7DFFF", axis_line_linewidth = 0.25, axis_ticks_colour = axis_line_colour, axis_ticks_linewidth = axis_line_linewidth, panel_grid_colour = "#00040AFF", panel_grid_linewidth = 1.33, panel_background_fill = "#050D1BFF", plot_background_fill = "#00040AFF", legend_axis_line_colour = plot_background_fill, legend_axis_line_linewidth = axis_line_linewidth, legend_background_fill = plot_background_fill, legend_key_fill = plot_background_fill, legend_ticks_colour = legend_axis_line_colour, legend_ticks_linewidth = legend_axis_line_linewidth, legend_ticks_length = ggplot2::rel(c(0.175, 0)) )
dark_mode_r( ..., base_size = 11, base_family = "", base_colour = "#C8D7DFFF", axis_line_colour = "#C8D7DFFF", axis_line_linewidth = 0.25, axis_ticks_colour = axis_line_colour, axis_ticks_linewidth = axis_line_linewidth, panel_grid_colour = "#00040AFF", panel_grid_linewidth = 1.33, panel_background_fill = "#050D1BFF", plot_background_fill = "#00040AFF", legend_axis_line_colour = plot_background_fill, legend_axis_line_linewidth = axis_line_linewidth, legend_background_fill = plot_background_fill, legend_key_fill = plot_background_fill, legend_ticks_colour = legend_axis_line_colour, legend_ticks_linewidth = legend_axis_line_linewidth, legend_ticks_length = ggplot2::rel(c(0.175, 0)) ) dark_mode_t( ..., base_size = 11, base_family = "", base_colour = "#C8D7DFFF", axis_line_colour = "#C8D7DFFF", axis_line_linewidth = 0.25, axis_ticks_colour = axis_line_colour, axis_ticks_linewidth = axis_line_linewidth, panel_grid_colour = "#00040AFF", panel_grid_linewidth = 1.33, panel_background_fill = "#050D1BFF", plot_background_fill = "#00040AFF", legend_axis_line_colour = plot_background_fill, legend_axis_line_linewidth = axis_line_linewidth, legend_background_fill = plot_background_fill, legend_key_fill = plot_background_fill, legend_ticks_colour = legend_axis_line_colour, legend_ticks_linewidth = legend_axis_line_linewidth, legend_ticks_length = ggplot2::rel(c(0.175, 0)) ) dark_mode_b( ..., base_size = 11, base_family = "", base_colour = "#C8D7DFFF", axis_line_colour = "#C8D7DFFF", axis_line_linewidth = 0.25, axis_ticks_colour = axis_line_colour, axis_ticks_linewidth = axis_line_linewidth, panel_grid_colour = "#00040AFF", panel_grid_linewidth = 1.33, panel_background_fill = "#050D1BFF", plot_background_fill = "#00040AFF", legend_axis_line_colour = plot_background_fill, legend_axis_line_linewidth = axis_line_linewidth, legend_background_fill = plot_background_fill, legend_key_fill = plot_background_fill, legend_ticks_colour = legend_axis_line_colour, legend_ticks_linewidth = legend_axis_line_linewidth, legend_ticks_length = ggplot2::rel(c(0.175, 0)) )
... |
Provided to require argument naming, support trailing commas etc. |
base_size |
The base size of the text theme element. Defaults to 11. |
base_family |
The base family of the text theme element. Defaults to "". |
base_colour |
The base colour of the text theme element. |
axis_line_colour |
The colour of the axis.line theme element. |
axis_line_linewidth |
The linewidth of the axis.line theme element. |
axis_ticks_colour |
The colour of the axis.ticks theme element. |
axis_ticks_linewidth |
The linewidth of the axis.ticks theme element. |
panel_grid_colour |
The colour of the panel.grid theme element. |
panel_grid_linewidth |
The linewidth of the panel.grid theme element. |
panel_background_fill |
The fill (and colour) of the panel.background theme element. |
plot_background_fill |
The fill (and colour) of the plot.background theme element. |
legend_axis_line_colour |
The colour of the legend.axis.line theme element. |
legend_axis_line_linewidth |
The linewidth of the legend.axis.line theme element. |
legend_background_fill |
The fill (and colour) of the legend.background theme element. |
legend_key_fill |
The fill (and colour) of the legend.key theme element. |
legend_ticks_colour |
The colour of the legend.ticks theme element. |
legend_ticks_linewidth |
The linewidth of the legend.ticks theme element. |
legend_ticks_length |
The legend.ticks.length theme element. |
A ggplot theme.
library(palmerpenguins) library(ggplot2) set_blanket() penguins |> gg_point( x = flipper_length_mm, y = body_mass_g, col = species, mode = dark_mode_r() ) penguins |> gg_point( x = flipper_length_mm, y = body_mass_g, col = species, mode = dark_mode_t() ) penguins |> gg_point( x = flipper_length_mm, y = body_mass_g, col = species, mode = dark_mode_b() )
library(palmerpenguins) library(ggplot2) set_blanket() penguins |> gg_point( x = flipper_length_mm, y = body_mass_g, col = species, mode = dark_mode_r() ) penguins |> gg_point( x = flipper_length_mm, y = body_mass_g, col = species, mode = dark_mode_t() ) penguins |> gg_point( x = flipper_length_mm, y = body_mass_g, col = species, mode = dark_mode_b() )
Create an area ggplot with a wrapper around ggplot2::ggplot()
+ geom_area().
gg_area( data = NULL, ..., stat = "align", position = "stack", coord = ggplot2::coord_cartesian(clip = "off"), theme = NULL, theme_orientation = NULL, theme_axis_line_rm = NULL, theme_axis_ticks_rm = NULL, theme_panel_grid_rm = NULL, blend = NULL, x = NULL, xmin = NULL, xmax = NULL, xend = NULL, y = NULL, ymin = NULL, ymax = NULL, yend = NULL, z = NULL, col = NULL, facet = NULL, facet2 = NULL, group = NULL, subgroup = NULL, label = NULL, text = NULL, sample = NULL, mapping = NULL, x_breaks = NULL, x_breaks_n = NULL, x_expand = NULL, x_expand_limits = NULL, x_label = NULL, x_labels = NULL, x_position = "bottom", x_sec_axis = ggplot2::waiver(), x_symmetric = NULL, x_transform = NULL, y_breaks = NULL, y_breaks_n = NULL, y_expand = NULL, y_expand_limits = NULL, y_label = NULL, y_labels = NULL, y_position = "left", y_sec_axis = ggplot2::waiver(), y_symmetric = NULL, y_transform = NULL, col_breaks = NULL, col_breaks_n = 5, col_drop = FALSE, col_expand_limits = NULL, col_label = NULL, col_labels = NULL, col_legend_ncol = NULL, col_legend_nrow = NULL, col_legend_rev = FALSE, col_palette = NULL, col_palette_na = NULL, col_rescale = scales::rescale(), col_steps = FALSE, col_transform = NULL, facet_axes = NULL, facet_axis_labels = "margins", facet_drop = FALSE, facet_labels = NULL, facet_layout = NULL, facet_ncol = NULL, facet_nrow = NULL, facet_scales = "fixed", facet_space = "fixed", title = NULL, subtitle = NULL, caption = NULL, label_case = NULL )
gg_area( data = NULL, ..., stat = "align", position = "stack", coord = ggplot2::coord_cartesian(clip = "off"), theme = NULL, theme_orientation = NULL, theme_axis_line_rm = NULL, theme_axis_ticks_rm = NULL, theme_panel_grid_rm = NULL, blend = NULL, x = NULL, xmin = NULL, xmax = NULL, xend = NULL, y = NULL, ymin = NULL, ymax = NULL, yend = NULL, z = NULL, col = NULL, facet = NULL, facet2 = NULL, group = NULL, subgroup = NULL, label = NULL, text = NULL, sample = NULL, mapping = NULL, x_breaks = NULL, x_breaks_n = NULL, x_expand = NULL, x_expand_limits = NULL, x_label = NULL, x_labels = NULL, x_position = "bottom", x_sec_axis = ggplot2::waiver(), x_symmetric = NULL, x_transform = NULL, y_breaks = NULL, y_breaks_n = NULL, y_expand = NULL, y_expand_limits = NULL, y_label = NULL, y_labels = NULL, y_position = "left", y_sec_axis = ggplot2::waiver(), y_symmetric = NULL, y_transform = NULL, col_breaks = NULL, col_breaks_n = 5, col_drop = FALSE, col_expand_limits = NULL, col_label = NULL, col_labels = NULL, col_legend_ncol = NULL, col_legend_nrow = NULL, col_legend_rev = FALSE, col_palette = NULL, col_palette_na = NULL, col_rescale = scales::rescale(), col_steps = FALSE, col_transform = NULL, facet_axes = NULL, facet_axis_labels = "margins", facet_drop = FALSE, facet_labels = NULL, facet_layout = NULL, facet_ncol = NULL, facet_nrow = NULL, facet_scales = "fixed", facet_space = "fixed", title = NULL, subtitle = NULL, caption = NULL, label_case = NULL )
data |
A data frame or tibble. |
... |
Other arguments passed to within a |
stat |
A statistical transformation to use on the data. A snakecase character string of a ggproto Stat subclass object minus the Stat prefix (e.g. |
position |
A position adjustment. A snakecase character string of a ggproto Position subclass object minus the Position prefix (e.g. |
coord |
A coordinate system. A |
theme |
A ggplot2 theme (e.g. |
theme_orientation |
The orientation of plot, which affects the theme components that are removed. Either |
theme_axis_line_rm |
|
theme_axis_ticks_rm |
|
theme_panel_grid_rm |
|
blend |
The blending mode per |
x , xmin , xmax , xend , y , ymin , ymax , yend , z , col , facet , facet2 , group , subgroup , label , text , sample
|
An unquoted aesthetic variable. |
mapping |
A set of additional aesthetic mappings in |
x_breaks , y_breaks , col_breaks
|
A |
x_breaks_n , y_breaks_n , col_breaks_n
|
A number of desired breaks for when |
x_expand , y_expand
|
Padding to the limits with the |
x_expand_limits , y_expand_limits , col_expand_limits
|
For a continuous variable, any values that the limits should encompass (e.g. |
x_label , y_label , col_label
|
Label for the axis or legend title. Use |
x_labels , y_labels , col_labels , facet_labels
|
A function that takes the breaks as inputs (e.g. |
x_position , y_position
|
The position of the axis (i.e. |
x_sec_axis , y_sec_axis
|
A secondary axis with |
x_symmetric , y_symmetric
|
|
x_transform , y_transform , col_transform
|
For a continuous scale, a transformation object (e.g. |
col_drop , facet_drop
|
For a discrete variable, FALSE or TRUE of whether to drop unused levels. |
col_legend_ncol , col_legend_nrow
|
The number of columns and rows in a legend guide. |
col_legend_rev |
|
col_palette |
A character vector of hex codes (or names) or a |
col_palette_na |
A hex code (or name) for the colour of |
col_rescale |
For a continuous variable, a |
col_steps |
For a continuous variable, |
facet_axes |
Whether to add interior axes and ticks with |
facet_axis_labels |
Whether to add interior axis labels with |
facet_layout |
Whether the layout is to be |
facet_ncol , facet_nrow
|
The number of columns and rows of facet panels. Only applies to a facet layout of |
facet_scales |
Whether facet scales should be |
facet_space |
When the facet scales are not |
title |
Title string. |
subtitle |
Subtitle string. |
caption |
Caption title string. |
label_case |
A function to format the label of unlabelled variables. Defaults to |
A ggplot object.
library(ggplot2) library(dplyr) set_blanket() economics |> gg_area( x = date, y = unemploy, y_label = "Unemployment", )
library(ggplot2) library(dplyr) set_blanket() economics |> gg_area( x = date, y = unemploy, y_label = "Unemployment", )
Create a bar ggplot with a wrapper around ggplot2::ggplot()
+ geom_bar().
gg_bar( data = NULL, ..., stat = "count", position = "stack", coord = ggplot2::coord_cartesian(clip = "off"), theme = NULL, theme_orientation = NULL, theme_axis_line_rm = NULL, theme_axis_ticks_rm = NULL, theme_panel_grid_rm = NULL, blend = NULL, x = NULL, xmin = NULL, xmax = NULL, xend = NULL, y = NULL, ymin = NULL, ymax = NULL, yend = NULL, z = NULL, col = NULL, facet = NULL, facet2 = NULL, group = NULL, subgroup = NULL, label = NULL, text = NULL, sample = NULL, mapping = NULL, x_breaks = NULL, x_breaks_n = NULL, x_expand = NULL, x_expand_limits = NULL, x_label = NULL, x_labels = NULL, x_position = "bottom", x_sec_axis = ggplot2::waiver(), x_symmetric = NULL, x_transform = NULL, y_breaks = NULL, y_breaks_n = NULL, y_expand = NULL, y_expand_limits = NULL, y_label = NULL, y_labels = NULL, y_position = "left", y_sec_axis = ggplot2::waiver(), y_symmetric = NULL, y_transform = NULL, col_breaks = NULL, col_breaks_n = 5, col_drop = FALSE, col_expand_limits = NULL, col_label = NULL, col_labels = NULL, col_legend_ncol = NULL, col_legend_nrow = NULL, col_legend_rev = FALSE, col_palette = NULL, col_palette_na = NULL, col_rescale = scales::rescale(), col_steps = FALSE, col_transform = NULL, facet_axes = NULL, facet_axis_labels = "margins", facet_drop = FALSE, facet_labels = NULL, facet_layout = NULL, facet_ncol = NULL, facet_nrow = NULL, facet_scales = "fixed", facet_space = "fixed", title = NULL, subtitle = NULL, caption = NULL, label_case = NULL )
gg_bar( data = NULL, ..., stat = "count", position = "stack", coord = ggplot2::coord_cartesian(clip = "off"), theme = NULL, theme_orientation = NULL, theme_axis_line_rm = NULL, theme_axis_ticks_rm = NULL, theme_panel_grid_rm = NULL, blend = NULL, x = NULL, xmin = NULL, xmax = NULL, xend = NULL, y = NULL, ymin = NULL, ymax = NULL, yend = NULL, z = NULL, col = NULL, facet = NULL, facet2 = NULL, group = NULL, subgroup = NULL, label = NULL, text = NULL, sample = NULL, mapping = NULL, x_breaks = NULL, x_breaks_n = NULL, x_expand = NULL, x_expand_limits = NULL, x_label = NULL, x_labels = NULL, x_position = "bottom", x_sec_axis = ggplot2::waiver(), x_symmetric = NULL, x_transform = NULL, y_breaks = NULL, y_breaks_n = NULL, y_expand = NULL, y_expand_limits = NULL, y_label = NULL, y_labels = NULL, y_position = "left", y_sec_axis = ggplot2::waiver(), y_symmetric = NULL, y_transform = NULL, col_breaks = NULL, col_breaks_n = 5, col_drop = FALSE, col_expand_limits = NULL, col_label = NULL, col_labels = NULL, col_legend_ncol = NULL, col_legend_nrow = NULL, col_legend_rev = FALSE, col_palette = NULL, col_palette_na = NULL, col_rescale = scales::rescale(), col_steps = FALSE, col_transform = NULL, facet_axes = NULL, facet_axis_labels = "margins", facet_drop = FALSE, facet_labels = NULL, facet_layout = NULL, facet_ncol = NULL, facet_nrow = NULL, facet_scales = "fixed", facet_space = "fixed", title = NULL, subtitle = NULL, caption = NULL, label_case = NULL )
data |
A data frame or tibble. |
... |
Other arguments passed to within a |
stat |
A statistical transformation to use on the data. A snakecase character string of a ggproto Stat subclass object minus the Stat prefix (e.g. |
position |
A position adjustment. A snakecase character string of a ggproto Position subclass object minus the Position prefix (e.g. |
coord |
A coordinate system. A |
theme |
A ggplot2 theme (e.g. |
theme_orientation |
The orientation of plot, which affects the theme components that are removed. Either |
theme_axis_line_rm |
|
theme_axis_ticks_rm |
|
theme_panel_grid_rm |
|
blend |
The blending mode per |
x , xmin , xmax , xend , y , ymin , ymax , yend , z , col , facet , facet2 , group , subgroup , label , text , sample
|
An unquoted aesthetic variable. |
mapping |
A set of additional aesthetic mappings in |
x_breaks , y_breaks , col_breaks
|
A |
x_breaks_n , y_breaks_n , col_breaks_n
|
A number of desired breaks for when |
x_expand , y_expand
|
Padding to the limits with the |
x_expand_limits , y_expand_limits , col_expand_limits
|
For a continuous variable, any values that the limits should encompass (e.g. |
x_label , y_label , col_label
|
Label for the axis or legend title. Use |
x_labels , y_labels , col_labels , facet_labels
|
A function that takes the breaks as inputs (e.g. |
x_position , y_position
|
The position of the axis (i.e. |
x_sec_axis , y_sec_axis
|
A secondary axis with |
x_symmetric , y_symmetric
|
|
x_transform , y_transform , col_transform
|
For a continuous scale, a transformation object (e.g. |
col_drop , facet_drop
|
For a discrete variable, FALSE or TRUE of whether to drop unused levels. |
col_legend_ncol , col_legend_nrow
|
The number of columns and rows in a legend guide. |
col_legend_rev |
|
col_palette |
A character vector of hex codes (or names) or a |
col_palette_na |
A hex code (or name) for the colour of |
col_rescale |
For a continuous variable, a |
col_steps |
For a continuous variable, |
facet_axes |
Whether to add interior axes and ticks with |
facet_axis_labels |
Whether to add interior axis labels with |
facet_layout |
Whether the layout is to be |
facet_ncol , facet_nrow
|
The number of columns and rows of facet panels. Only applies to a facet layout of |
facet_scales |
Whether facet scales should be |
facet_space |
When the facet scales are not |
title |
Title string. |
subtitle |
Subtitle string. |
caption |
Caption title string. |
label_case |
A function to format the label of unlabelled variables. Defaults to |
A ggplot object.
library(ggplot2) library(dplyr) library(palmerpenguins) set_blanket() penguins |> gg_bar( y = species, width = 0.75, )
library(ggplot2) library(dplyr) library(palmerpenguins) set_blanket() penguins |> gg_bar( y = species, width = 0.75, )
Create a bin2d ggplot with a wrapper around ggplot2::ggplot()
+ geom_bin_2d().
gg_bin_2d( data = NULL, ..., stat = "bin2d", position = "identity", coord = ggplot2::coord_cartesian(clip = "off"), theme = NULL, theme_orientation = NULL, theme_axis_line_rm = NULL, theme_axis_ticks_rm = NULL, theme_panel_grid_rm = NULL, blend = NULL, x = NULL, xmin = NULL, xmax = NULL, xend = NULL, y = NULL, ymin = NULL, ymax = NULL, yend = NULL, z = NULL, col = NULL, facet = NULL, facet2 = NULL, group = NULL, subgroup = NULL, label = NULL, text = NULL, sample = NULL, mapping = NULL, x_breaks = NULL, x_breaks_n = NULL, x_expand = NULL, x_expand_limits = NULL, x_label = NULL, x_labels = NULL, x_position = "bottom", x_sec_axis = ggplot2::waiver(), x_symmetric = NULL, x_transform = NULL, y_breaks = NULL, y_breaks_n = NULL, y_expand = NULL, y_expand_limits = NULL, y_label = NULL, y_labels = NULL, y_position = "left", y_sec_axis = ggplot2::waiver(), y_symmetric = NULL, y_transform = NULL, col_breaks = NULL, col_breaks_n = 5, col_drop = FALSE, col_expand_limits = NULL, col_label = NULL, col_labels = NULL, col_legend_ncol = NULL, col_legend_nrow = NULL, col_legend_rev = FALSE, col_palette = NULL, col_palette_na = NULL, col_rescale = scales::rescale(), col_steps = FALSE, col_transform = NULL, facet_axes = NULL, facet_axis_labels = "margins", facet_drop = FALSE, facet_labels = NULL, facet_layout = NULL, facet_ncol = NULL, facet_nrow = NULL, facet_scales = "fixed", facet_space = "fixed", title = NULL, subtitle = NULL, caption = NULL, label_case = NULL )
gg_bin_2d( data = NULL, ..., stat = "bin2d", position = "identity", coord = ggplot2::coord_cartesian(clip = "off"), theme = NULL, theme_orientation = NULL, theme_axis_line_rm = NULL, theme_axis_ticks_rm = NULL, theme_panel_grid_rm = NULL, blend = NULL, x = NULL, xmin = NULL, xmax = NULL, xend = NULL, y = NULL, ymin = NULL, ymax = NULL, yend = NULL, z = NULL, col = NULL, facet = NULL, facet2 = NULL, group = NULL, subgroup = NULL, label = NULL, text = NULL, sample = NULL, mapping = NULL, x_breaks = NULL, x_breaks_n = NULL, x_expand = NULL, x_expand_limits = NULL, x_label = NULL, x_labels = NULL, x_position = "bottom", x_sec_axis = ggplot2::waiver(), x_symmetric = NULL, x_transform = NULL, y_breaks = NULL, y_breaks_n = NULL, y_expand = NULL, y_expand_limits = NULL, y_label = NULL, y_labels = NULL, y_position = "left", y_sec_axis = ggplot2::waiver(), y_symmetric = NULL, y_transform = NULL, col_breaks = NULL, col_breaks_n = 5, col_drop = FALSE, col_expand_limits = NULL, col_label = NULL, col_labels = NULL, col_legend_ncol = NULL, col_legend_nrow = NULL, col_legend_rev = FALSE, col_palette = NULL, col_palette_na = NULL, col_rescale = scales::rescale(), col_steps = FALSE, col_transform = NULL, facet_axes = NULL, facet_axis_labels = "margins", facet_drop = FALSE, facet_labels = NULL, facet_layout = NULL, facet_ncol = NULL, facet_nrow = NULL, facet_scales = "fixed", facet_space = "fixed", title = NULL, subtitle = NULL, caption = NULL, label_case = NULL )
data |
A data frame or tibble. |
... |
Other arguments passed to within a |
stat |
A statistical transformation to use on the data. A snakecase character string of a ggproto Stat subclass object minus the Stat prefix (e.g. |
position |
A position adjustment. A snakecase character string of a ggproto Position subclass object minus the Position prefix (e.g. |
coord |
A coordinate system. A |
theme |
A ggplot2 theme (e.g. |
theme_orientation |
The orientation of plot, which affects the theme components that are removed. Either |
theme_axis_line_rm |
|
theme_axis_ticks_rm |
|
theme_panel_grid_rm |
|
blend |
The blending mode per |
x , xmin , xmax , xend , y , ymin , ymax , yend , z , col , facet , facet2 , group , subgroup , label , text , sample
|
An unquoted aesthetic variable. |
mapping |
A set of additional aesthetic mappings in |
x_breaks , y_breaks , col_breaks
|
A |
x_breaks_n , y_breaks_n , col_breaks_n
|
A number of desired breaks for when |
x_expand , y_expand
|
Padding to the limits with the |
x_expand_limits , y_expand_limits , col_expand_limits
|
For a continuous variable, any values that the limits should encompass (e.g. |
x_label , y_label , col_label
|
Label for the axis or legend title. Use |
x_labels , y_labels , col_labels , facet_labels
|
A function that takes the breaks as inputs (e.g. |
x_position , y_position
|
The position of the axis (i.e. |
x_sec_axis , y_sec_axis
|
A secondary axis with |
x_symmetric , y_symmetric
|
|
x_transform , y_transform , col_transform
|
For a continuous scale, a transformation object (e.g. |
col_drop , facet_drop
|
For a discrete variable, FALSE or TRUE of whether to drop unused levels. |
col_legend_ncol , col_legend_nrow
|
The number of columns and rows in a legend guide. |
col_legend_rev |
|
col_palette |
A character vector of hex codes (or names) or a |
col_palette_na |
A hex code (or name) for the colour of |
col_rescale |
For a continuous variable, a |
col_steps |
For a continuous variable, |
facet_axes |
Whether to add interior axes and ticks with |
facet_axis_labels |
Whether to add interior axis labels with |
facet_layout |
Whether the layout is to be |
facet_ncol , facet_nrow
|
The number of columns and rows of facet panels. Only applies to a facet layout of |
facet_scales |
Whether facet scales should be |
facet_space |
When the facet scales are not |
title |
Title string. |
subtitle |
Subtitle string. |
caption |
Caption title string. |
label_case |
A function to format the label of unlabelled variables. Defaults to |
A ggplot object.
library(ggplot2) library(dplyr) set_blanket() diamonds |> gg_bin_2d( x = carat, y = price, )
library(ggplot2) library(dplyr) set_blanket() diamonds |> gg_bin_2d( x = carat, y = price, )
Create a blanket ggplot with a wrapper around ggplot2::ggplot()
+ layer()
with geom_blank() defaults. This function underlies all other gg_*
functions. It contains a geom
argument for maximum flexibility.
gg_blanket( data = NULL, ..., geom = "blank", stat = "identity", position = "identity", coord = NULL, theme = NULL, theme_orientation = NULL, theme_axis_line_rm = NULL, theme_axis_ticks_rm = NULL, theme_panel_grid_rm = NULL, blend = NULL, x = NULL, xmin = NULL, xmax = NULL, xend = NULL, y = NULL, ymin = NULL, ymax = NULL, yend = NULL, z = NULL, col = NULL, facet = NULL, facet2 = NULL, group = NULL, subgroup = NULL, label = NULL, text = NULL, sample = NULL, mapping = NULL, x_breaks = NULL, x_breaks_n = NULL, x_expand = NULL, x_expand_limits = NULL, x_label = NULL, x_labels = NULL, x_position = "bottom", x_sec_axis = ggplot2::waiver(), x_symmetric = NULL, x_transform = NULL, y_breaks = NULL, y_breaks_n = NULL, y_expand = NULL, y_expand_limits = NULL, y_label = NULL, y_labels = NULL, y_position = "left", y_sec_axis = ggplot2::waiver(), y_symmetric = NULL, y_transform = NULL, col_breaks = NULL, col_breaks_n = 5, col_drop = FALSE, col_expand_limits = NULL, col_label = NULL, col_labels = NULL, col_legend_ncol = NULL, col_legend_nrow = NULL, col_legend_rev = FALSE, col_palette = NULL, col_palette_na = NULL, col_rescale = scales::rescale(), col_steps = FALSE, col_transform = NULL, facet_axes = NULL, facet_axis_labels = "margins", facet_drop = FALSE, facet_labels = NULL, facet_layout = NULL, facet_ncol = NULL, facet_nrow = NULL, facet_scales = "fixed", facet_space = "fixed", title = NULL, subtitle = NULL, caption = NULL, label_case = NULL )
gg_blanket( data = NULL, ..., geom = "blank", stat = "identity", position = "identity", coord = NULL, theme = NULL, theme_orientation = NULL, theme_axis_line_rm = NULL, theme_axis_ticks_rm = NULL, theme_panel_grid_rm = NULL, blend = NULL, x = NULL, xmin = NULL, xmax = NULL, xend = NULL, y = NULL, ymin = NULL, ymax = NULL, yend = NULL, z = NULL, col = NULL, facet = NULL, facet2 = NULL, group = NULL, subgroup = NULL, label = NULL, text = NULL, sample = NULL, mapping = NULL, x_breaks = NULL, x_breaks_n = NULL, x_expand = NULL, x_expand_limits = NULL, x_label = NULL, x_labels = NULL, x_position = "bottom", x_sec_axis = ggplot2::waiver(), x_symmetric = NULL, x_transform = NULL, y_breaks = NULL, y_breaks_n = NULL, y_expand = NULL, y_expand_limits = NULL, y_label = NULL, y_labels = NULL, y_position = "left", y_sec_axis = ggplot2::waiver(), y_symmetric = NULL, y_transform = NULL, col_breaks = NULL, col_breaks_n = 5, col_drop = FALSE, col_expand_limits = NULL, col_label = NULL, col_labels = NULL, col_legend_ncol = NULL, col_legend_nrow = NULL, col_legend_rev = FALSE, col_palette = NULL, col_palette_na = NULL, col_rescale = scales::rescale(), col_steps = FALSE, col_transform = NULL, facet_axes = NULL, facet_axis_labels = "margins", facet_drop = FALSE, facet_labels = NULL, facet_layout = NULL, facet_ncol = NULL, facet_nrow = NULL, facet_scales = "fixed", facet_space = "fixed", title = NULL, subtitle = NULL, caption = NULL, label_case = NULL )
data |
A data frame or tibble. |
... |
Other arguments passed to within a |
geom |
A geometric object to display the data. A snakecase character string of a ggproto Geom subclass object minus the Geom prefix (e.g. |
stat |
A statistical transformation to use on the data. A snakecase character string of a ggproto Stat subclass object minus the Stat prefix (e.g. |
position |
A position adjustment. A snakecase character string of a ggproto Position subclass object minus the Position prefix (e.g. |
coord |
A coordinate system. A |
theme |
A ggplot2 theme (e.g. |
theme_orientation |
The orientation of plot, which affects the theme components that are removed. Either |
theme_axis_line_rm |
|
theme_axis_ticks_rm |
|
theme_panel_grid_rm |
|
blend |
The blending mode per |
x , xmin , xmax , xend , y , ymin , ymax , yend , z , col , facet , facet2 , group , subgroup , label , text , sample
|
An unquoted aesthetic variable. |
mapping |
A set of additional aesthetic mappings in |
x_breaks , y_breaks , col_breaks
|
A |
x_breaks_n , y_breaks_n , col_breaks_n
|
A number of desired breaks for when |
x_expand , y_expand
|
Padding to the limits with the |
x_expand_limits , y_expand_limits , col_expand_limits
|
For a continuous variable, any values that the limits should encompass (e.g. |
x_label , y_label , col_label
|
Label for the axis or legend title. Use |
x_labels , y_labels , col_labels , facet_labels
|
A function that takes the breaks as inputs (e.g. |
x_position , y_position
|
The position of the axis (i.e. |
x_sec_axis , y_sec_axis
|
A secondary axis with |
x_symmetric , y_symmetric
|
|
x_transform , y_transform , col_transform
|
For a continuous scale, a transformation object (e.g. |
col_drop , facet_drop
|
For a discrete variable, FALSE or TRUE of whether to drop unused levels. |
col_legend_ncol , col_legend_nrow
|
The number of columns and rows in a legend guide. |
col_legend_rev |
|
col_palette |
A character vector of hex codes (or names) or a |
col_palette_na |
A hex code (or name) for the colour of |
col_rescale |
For a continuous variable, a |
col_steps |
For a continuous variable, |
facet_axes |
Whether to add interior axes and ticks with |
facet_axis_labels |
Whether to add interior axis labels with |
facet_layout |
Whether the layout is to be |
facet_ncol , facet_nrow
|
The number of columns and rows of facet panels. Only applies to a facet layout of |
facet_scales |
Whether facet scales should be |
facet_space |
When the facet scales are not |
title |
Title string. |
subtitle |
Subtitle string. |
caption |
Caption title string. |
label_case |
A function to format the label of unlabelled variables. Defaults to |
A ggplot object.
library(ggplot2) library(dplyr) library(palmerpenguins) set_blanket() penguins |> gg_blanket( geom = "violin", stat = "ydensity", position = "dodge", x = species, y = body_mass_g, col = sex, )
library(ggplot2) library(dplyr) library(palmerpenguins) set_blanket() penguins |> gg_blanket( geom = "violin", stat = "ydensity", position = "dodge", x = species, y = body_mass_g, col = sex, )
Create a boxplot ggplot with a wrapper around ggplot2::ggplot()
+ geom_boxplot().
gg_boxplot( data = NULL, ..., stat = "boxplot", position = "dodge2", coord = ggplot2::coord_cartesian(clip = "off"), theme = NULL, theme_orientation = NULL, theme_axis_line_rm = NULL, theme_axis_ticks_rm = NULL, theme_panel_grid_rm = NULL, blend = NULL, x = NULL, xmin = NULL, xmax = NULL, xend = NULL, y = NULL, ymin = NULL, ymax = NULL, yend = NULL, z = NULL, col = NULL, facet = NULL, facet2 = NULL, group = NULL, subgroup = NULL, label = NULL, text = NULL, sample = NULL, mapping = NULL, x_breaks = NULL, x_breaks_n = NULL, x_expand = NULL, x_expand_limits = NULL, x_label = NULL, x_labels = NULL, x_position = "bottom", x_sec_axis = ggplot2::waiver(), x_symmetric = NULL, x_transform = NULL, y_breaks = NULL, y_breaks_n = NULL, y_expand = NULL, y_expand_limits = NULL, y_label = NULL, y_labels = NULL, y_position = "left", y_sec_axis = ggplot2::waiver(), y_symmetric = NULL, y_transform = NULL, col_breaks = NULL, col_breaks_n = 5, col_drop = FALSE, col_expand_limits = NULL, col_label = NULL, col_labels = NULL, col_legend_ncol = NULL, col_legend_nrow = NULL, col_legend_rev = FALSE, col_palette = NULL, col_palette_na = NULL, col_rescale = scales::rescale(), col_steps = FALSE, col_transform = NULL, facet_axes = NULL, facet_axis_labels = "margins", facet_drop = FALSE, facet_labels = NULL, facet_layout = NULL, facet_ncol = NULL, facet_nrow = NULL, facet_scales = "fixed", facet_space = "fixed", title = NULL, subtitle = NULL, caption = NULL, label_case = NULL )
gg_boxplot( data = NULL, ..., stat = "boxplot", position = "dodge2", coord = ggplot2::coord_cartesian(clip = "off"), theme = NULL, theme_orientation = NULL, theme_axis_line_rm = NULL, theme_axis_ticks_rm = NULL, theme_panel_grid_rm = NULL, blend = NULL, x = NULL, xmin = NULL, xmax = NULL, xend = NULL, y = NULL, ymin = NULL, ymax = NULL, yend = NULL, z = NULL, col = NULL, facet = NULL, facet2 = NULL, group = NULL, subgroup = NULL, label = NULL, text = NULL, sample = NULL, mapping = NULL, x_breaks = NULL, x_breaks_n = NULL, x_expand = NULL, x_expand_limits = NULL, x_label = NULL, x_labels = NULL, x_position = "bottom", x_sec_axis = ggplot2::waiver(), x_symmetric = NULL, x_transform = NULL, y_breaks = NULL, y_breaks_n = NULL, y_expand = NULL, y_expand_limits = NULL, y_label = NULL, y_labels = NULL, y_position = "left", y_sec_axis = ggplot2::waiver(), y_symmetric = NULL, y_transform = NULL, col_breaks = NULL, col_breaks_n = 5, col_drop = FALSE, col_expand_limits = NULL, col_label = NULL, col_labels = NULL, col_legend_ncol = NULL, col_legend_nrow = NULL, col_legend_rev = FALSE, col_palette = NULL, col_palette_na = NULL, col_rescale = scales::rescale(), col_steps = FALSE, col_transform = NULL, facet_axes = NULL, facet_axis_labels = "margins", facet_drop = FALSE, facet_labels = NULL, facet_layout = NULL, facet_ncol = NULL, facet_nrow = NULL, facet_scales = "fixed", facet_space = "fixed", title = NULL, subtitle = NULL, caption = NULL, label_case = NULL )
data |
A data frame or tibble. |
... |
Other arguments passed to within a |
stat |
A statistical transformation to use on the data. A snakecase character string of a ggproto Stat subclass object minus the Stat prefix (e.g. |
position |
A position adjustment. A snakecase character string of a ggproto Position subclass object minus the Position prefix (e.g. |
coord |
A coordinate system. A |
theme |
A ggplot2 theme (e.g. |
theme_orientation |
The orientation of plot, which affects the theme components that are removed. Either |
theme_axis_line_rm |
|
theme_axis_ticks_rm |
|
theme_panel_grid_rm |
|
blend |
The blending mode per |
x , xmin , xmax , xend , y , ymin , ymax , yend , z , col , facet , facet2 , group , subgroup , label , text , sample
|
An unquoted aesthetic variable. |
mapping |
A set of additional aesthetic mappings in |
x_breaks , y_breaks , col_breaks
|
A |
x_breaks_n , y_breaks_n , col_breaks_n
|
A number of desired breaks for when |
x_expand , y_expand
|
Padding to the limits with the |
x_expand_limits , y_expand_limits , col_expand_limits
|
For a continuous variable, any values that the limits should encompass (e.g. |
x_label , y_label , col_label
|
Label for the axis or legend title. Use |
x_labels , y_labels , col_labels , facet_labels
|
A function that takes the breaks as inputs (e.g. |
x_position , y_position
|
The position of the axis (i.e. |
x_sec_axis , y_sec_axis
|
A secondary axis with |
x_symmetric , y_symmetric
|
|
x_transform , y_transform , col_transform
|
For a continuous scale, a transformation object (e.g. |
col_drop , facet_drop
|
For a discrete variable, FALSE or TRUE of whether to drop unused levels. |
col_legend_ncol , col_legend_nrow
|
The number of columns and rows in a legend guide. |
col_legend_rev |
|
col_palette |
A character vector of hex codes (or names) or a |
col_palette_na |
A hex code (or name) for the colour of |
col_rescale |
For a continuous variable, a |
col_steps |
For a continuous variable, |
facet_axes |
Whether to add interior axes and ticks with |
facet_axis_labels |
Whether to add interior axis labels with |
facet_layout |
Whether the layout is to be |
facet_ncol , facet_nrow
|
The number of columns and rows of facet panels. Only applies to a facet layout of |
facet_scales |
Whether facet scales should be |
facet_space |
When the facet scales are not |
title |
Title string. |
subtitle |
Subtitle string. |
caption |
Caption title string. |
label_case |
A function to format the label of unlabelled variables. Defaults to |
A ggplot object.
library(ggplot2) library(dplyr) library(palmerpenguins) set_blanket() penguins |> gg_boxplot( x = flipper_length_mm, y = species, col = sex, blend = "multiply", )
library(ggplot2) library(dplyr) library(palmerpenguins) set_blanket() penguins |> gg_boxplot( x = flipper_length_mm, y = species, col = sex, blend = "multiply", )
Create a col ggplot with a wrapper around ggplot2::ggplot()
+ geom_col().
gg_col( data = NULL, ..., stat = "identity", position = "stack", coord = ggplot2::coord_cartesian(clip = "off"), theme = NULL, theme_orientation = NULL, theme_axis_line_rm = NULL, theme_axis_ticks_rm = NULL, theme_panel_grid_rm = NULL, blend = NULL, x = NULL, xmin = NULL, xmax = NULL, xend = NULL, y = NULL, ymin = NULL, ymax = NULL, yend = NULL, z = NULL, col = NULL, facet = NULL, facet2 = NULL, group = NULL, subgroup = NULL, label = NULL, text = NULL, sample = NULL, mapping = NULL, x_breaks = NULL, x_breaks_n = NULL, x_expand = NULL, x_expand_limits = NULL, x_label = NULL, x_labels = NULL, x_position = "bottom", x_sec_axis = ggplot2::waiver(), x_symmetric = NULL, x_transform = NULL, y_breaks = NULL, y_breaks_n = NULL, y_expand = NULL, y_expand_limits = NULL, y_label = NULL, y_labels = NULL, y_position = "left", y_sec_axis = ggplot2::waiver(), y_symmetric = NULL, y_transform = NULL, col_breaks = NULL, col_breaks_n = 5, col_drop = FALSE, col_expand_limits = NULL, col_label = NULL, col_labels = NULL, col_legend_ncol = NULL, col_legend_nrow = NULL, col_legend_rev = FALSE, col_palette = NULL, col_palette_na = NULL, col_rescale = scales::rescale(), col_steps = FALSE, col_transform = NULL, facet_axes = NULL, facet_axis_labels = "margins", facet_drop = FALSE, facet_labels = NULL, facet_layout = NULL, facet_ncol = NULL, facet_nrow = NULL, facet_scales = "fixed", facet_space = "fixed", title = NULL, subtitle = NULL, caption = NULL, label_case = NULL )
gg_col( data = NULL, ..., stat = "identity", position = "stack", coord = ggplot2::coord_cartesian(clip = "off"), theme = NULL, theme_orientation = NULL, theme_axis_line_rm = NULL, theme_axis_ticks_rm = NULL, theme_panel_grid_rm = NULL, blend = NULL, x = NULL, xmin = NULL, xmax = NULL, xend = NULL, y = NULL, ymin = NULL, ymax = NULL, yend = NULL, z = NULL, col = NULL, facet = NULL, facet2 = NULL, group = NULL, subgroup = NULL, label = NULL, text = NULL, sample = NULL, mapping = NULL, x_breaks = NULL, x_breaks_n = NULL, x_expand = NULL, x_expand_limits = NULL, x_label = NULL, x_labels = NULL, x_position = "bottom", x_sec_axis = ggplot2::waiver(), x_symmetric = NULL, x_transform = NULL, y_breaks = NULL, y_breaks_n = NULL, y_expand = NULL, y_expand_limits = NULL, y_label = NULL, y_labels = NULL, y_position = "left", y_sec_axis = ggplot2::waiver(), y_symmetric = NULL, y_transform = NULL, col_breaks = NULL, col_breaks_n = 5, col_drop = FALSE, col_expand_limits = NULL, col_label = NULL, col_labels = NULL, col_legend_ncol = NULL, col_legend_nrow = NULL, col_legend_rev = FALSE, col_palette = NULL, col_palette_na = NULL, col_rescale = scales::rescale(), col_steps = FALSE, col_transform = NULL, facet_axes = NULL, facet_axis_labels = "margins", facet_drop = FALSE, facet_labels = NULL, facet_layout = NULL, facet_ncol = NULL, facet_nrow = NULL, facet_scales = "fixed", facet_space = "fixed", title = NULL, subtitle = NULL, caption = NULL, label_case = NULL )
data |
A data frame or tibble. |
... |
Other arguments passed to within a |
stat |
A statistical transformation to use on the data. A snakecase character string of a ggproto Stat subclass object minus the Stat prefix (e.g. |
position |
A position adjustment. A snakecase character string of a ggproto Position subclass object minus the Position prefix (e.g. |
coord |
A coordinate system. A |
theme |
A ggplot2 theme (e.g. |
theme_orientation |
The orientation of plot, which affects the theme components that are removed. Either |
theme_axis_line_rm |
|
theme_axis_ticks_rm |
|
theme_panel_grid_rm |
|
blend |
The blending mode per |
x , xmin , xmax , xend , y , ymin , ymax , yend , z , col , facet , facet2 , group , subgroup , label , text , sample
|
An unquoted aesthetic variable. |
mapping |
A set of additional aesthetic mappings in |
x_breaks , y_breaks , col_breaks
|
A |
x_breaks_n , y_breaks_n , col_breaks_n
|
A number of desired breaks for when |
x_expand , y_expand
|
Padding to the limits with the |
x_expand_limits , y_expand_limits , col_expand_limits
|
For a continuous variable, any values that the limits should encompass (e.g. |
x_label , y_label , col_label
|
Label for the axis or legend title. Use |
x_labels , y_labels , col_labels , facet_labels
|
A function that takes the breaks as inputs (e.g. |
x_position , y_position
|
The position of the axis (i.e. |
x_sec_axis , y_sec_axis
|
A secondary axis with |
x_symmetric , y_symmetric
|
|
x_transform , y_transform , col_transform
|
For a continuous scale, a transformation object (e.g. |
col_drop , facet_drop
|
For a discrete variable, FALSE or TRUE of whether to drop unused levels. |
col_legend_ncol , col_legend_nrow
|
The number of columns and rows in a legend guide. |
col_legend_rev |
|
col_palette |
A character vector of hex codes (or names) or a |
col_palette_na |
A hex code (or name) for the colour of |
col_rescale |
For a continuous variable, a |
col_steps |
For a continuous variable, |
facet_axes |
Whether to add interior axes and ticks with |
facet_axis_labels |
Whether to add interior axis labels with |
facet_layout |
Whether the layout is to be |
facet_ncol , facet_nrow
|
The number of columns and rows of facet panels. Only applies to a facet layout of |
facet_scales |
Whether facet scales should be |
facet_space |
When the facet scales are not |
title |
Title string. |
subtitle |
Subtitle string. |
caption |
Caption title string. |
label_case |
A function to format the label of unlabelled variables. Defaults to |
A ggplot object.
library(ggplot2) library(dplyr) library(palmerpenguins) set_blanket() penguins |> tidyr::drop_na(sex) |> group_by(sex, species) |> summarise(across(flipper_length_mm, \(x) mean(x, na.rm = TRUE))) |> gg_col( x = flipper_length_mm, y = species, col = sex, position = position_dodge(preserve = "single"), width = 0.75, )
library(ggplot2) library(dplyr) library(palmerpenguins) set_blanket() penguins |> tidyr::drop_na(sex) |> group_by(sex, species) |> summarise(across(flipper_length_mm, \(x) mean(x, na.rm = TRUE))) |> gg_col( x = flipper_length_mm, y = species, col = sex, position = position_dodge(preserve = "single"), width = 0.75, )
Create a contour ggplot with a wrapper around ggplot2::ggplot()
+ geom_contour().
gg_contour( data = NULL, ..., stat = "contour", position = "identity", coord = ggplot2::coord_cartesian(clip = "off"), theme = NULL, theme_orientation = NULL, theme_axis_line_rm = NULL, theme_axis_ticks_rm = NULL, theme_panel_grid_rm = NULL, blend = NULL, x = NULL, xmin = NULL, xmax = NULL, xend = NULL, y = NULL, ymin = NULL, ymax = NULL, yend = NULL, z = NULL, col = NULL, facet = NULL, facet2 = NULL, group = NULL, subgroup = NULL, label = NULL, text = NULL, sample = NULL, mapping = NULL, x_breaks = NULL, x_breaks_n = NULL, x_expand = NULL, x_expand_limits = NULL, x_label = NULL, x_labels = NULL, x_position = "bottom", x_sec_axis = ggplot2::waiver(), x_symmetric = NULL, x_transform = NULL, y_breaks = NULL, y_breaks_n = NULL, y_expand = NULL, y_expand_limits = NULL, y_label = NULL, y_labels = NULL, y_position = "left", y_sec_axis = ggplot2::waiver(), y_symmetric = NULL, y_transform = NULL, col_breaks = NULL, col_breaks_n = 5, col_drop = FALSE, col_expand_limits = NULL, col_label = NULL, col_labels = NULL, col_legend_ncol = NULL, col_legend_nrow = NULL, col_legend_rev = FALSE, col_palette = NULL, col_palette_na = NULL, col_rescale = scales::rescale(), col_steps = FALSE, col_transform = NULL, facet_axes = NULL, facet_axis_labels = "margins", facet_drop = FALSE, facet_labels = NULL, facet_layout = NULL, facet_ncol = NULL, facet_nrow = NULL, facet_scales = "fixed", facet_space = "fixed", title = NULL, subtitle = NULL, caption = NULL, label_case = NULL )
gg_contour( data = NULL, ..., stat = "contour", position = "identity", coord = ggplot2::coord_cartesian(clip = "off"), theme = NULL, theme_orientation = NULL, theme_axis_line_rm = NULL, theme_axis_ticks_rm = NULL, theme_panel_grid_rm = NULL, blend = NULL, x = NULL, xmin = NULL, xmax = NULL, xend = NULL, y = NULL, ymin = NULL, ymax = NULL, yend = NULL, z = NULL, col = NULL, facet = NULL, facet2 = NULL, group = NULL, subgroup = NULL, label = NULL, text = NULL, sample = NULL, mapping = NULL, x_breaks = NULL, x_breaks_n = NULL, x_expand = NULL, x_expand_limits = NULL, x_label = NULL, x_labels = NULL, x_position = "bottom", x_sec_axis = ggplot2::waiver(), x_symmetric = NULL, x_transform = NULL, y_breaks = NULL, y_breaks_n = NULL, y_expand = NULL, y_expand_limits = NULL, y_label = NULL, y_labels = NULL, y_position = "left", y_sec_axis = ggplot2::waiver(), y_symmetric = NULL, y_transform = NULL, col_breaks = NULL, col_breaks_n = 5, col_drop = FALSE, col_expand_limits = NULL, col_label = NULL, col_labels = NULL, col_legend_ncol = NULL, col_legend_nrow = NULL, col_legend_rev = FALSE, col_palette = NULL, col_palette_na = NULL, col_rescale = scales::rescale(), col_steps = FALSE, col_transform = NULL, facet_axes = NULL, facet_axis_labels = "margins", facet_drop = FALSE, facet_labels = NULL, facet_layout = NULL, facet_ncol = NULL, facet_nrow = NULL, facet_scales = "fixed", facet_space = "fixed", title = NULL, subtitle = NULL, caption = NULL, label_case = NULL )
data |
A data frame or tibble. |
... |
Other arguments passed to within a |
stat |
A statistical transformation to use on the data. A snakecase character string of a ggproto Stat subclass object minus the Stat prefix (e.g. |
position |
A position adjustment. A snakecase character string of a ggproto Position subclass object minus the Position prefix (e.g. |
coord |
A coordinate system. A |
theme |
A ggplot2 theme (e.g. |
theme_orientation |
The orientation of plot, which affects the theme components that are removed. Either |
theme_axis_line_rm |
|
theme_axis_ticks_rm |
|
theme_panel_grid_rm |
|
blend |
The blending mode per |
x , xmin , xmax , xend , y , ymin , ymax , yend , z , col , facet , facet2 , group , subgroup , label , text , sample
|
An unquoted aesthetic variable. |
mapping |
A set of additional aesthetic mappings in |
x_breaks , y_breaks , col_breaks
|
A |
x_breaks_n , y_breaks_n , col_breaks_n
|
A number of desired breaks for when |
x_expand , y_expand
|
Padding to the limits with the |
x_expand_limits , y_expand_limits , col_expand_limits
|
For a continuous variable, any values that the limits should encompass (e.g. |
x_label , y_label , col_label
|
Label for the axis or legend title. Use |
x_labels , y_labels , col_labels , facet_labels
|
A function that takes the breaks as inputs (e.g. |
x_position , y_position
|
The position of the axis (i.e. |
x_sec_axis , y_sec_axis
|
A secondary axis with |
x_symmetric , y_symmetric
|
|
x_transform , y_transform , col_transform
|
For a continuous scale, a transformation object (e.g. |
col_drop , facet_drop
|
For a discrete variable, FALSE or TRUE of whether to drop unused levels. |
col_legend_ncol , col_legend_nrow
|
The number of columns and rows in a legend guide. |
col_legend_rev |
|
col_palette |
A character vector of hex codes (or names) or a |
col_palette_na |
A hex code (or name) for the colour of |
col_rescale |
For a continuous variable, a |
col_steps |
For a continuous variable, |
facet_axes |
Whether to add interior axes and ticks with |
facet_axis_labels |
Whether to add interior axis labels with |
facet_layout |
Whether the layout is to be |
facet_ncol , facet_nrow
|
The number of columns and rows of facet panels. Only applies to a facet layout of |
facet_scales |
Whether facet scales should be |
facet_space |
When the facet scales are not |
title |
Title string. |
subtitle |
Subtitle string. |
caption |
Caption title string. |
label_case |
A function to format the label of unlabelled variables. Defaults to |
A ggplot object.
library(ggplot2) library(dplyr) set_blanket() ggplot2::faithfuld |> gg_contour( x = waiting, y = eruptions, z = density, )
library(ggplot2) library(dplyr) set_blanket() ggplot2::faithfuld |> gg_contour( x = waiting, y = eruptions, z = density, )
Create a contour_filled ggplot with a wrapper around ggplot2::ggplot()
+ geom_contour_filled().
gg_contour_filled( data = NULL, ..., stat = "contour_filled", position = "identity", coord = ggplot2::coord_cartesian(clip = "off"), theme = NULL, theme_orientation = NULL, theme_axis_line_rm = NULL, theme_axis_ticks_rm = NULL, theme_panel_grid_rm = NULL, blend = NULL, x = NULL, xmin = NULL, xmax = NULL, xend = NULL, y = NULL, ymin = NULL, ymax = NULL, yend = NULL, z = NULL, col = NULL, facet = NULL, facet2 = NULL, group = NULL, subgroup = NULL, label = NULL, text = NULL, sample = NULL, mapping = NULL, x_breaks = NULL, x_breaks_n = NULL, x_expand = NULL, x_expand_limits = NULL, x_label = NULL, x_labels = NULL, x_position = "bottom", x_sec_axis = ggplot2::waiver(), x_symmetric = NULL, x_transform = NULL, y_breaks = NULL, y_breaks_n = NULL, y_expand = NULL, y_expand_limits = NULL, y_label = NULL, y_labels = NULL, y_position = "left", y_sec_axis = ggplot2::waiver(), y_symmetric = NULL, y_transform = NULL, col_breaks = NULL, col_breaks_n = 5, col_drop = FALSE, col_expand_limits = NULL, col_label = NULL, col_labels = NULL, col_legend_ncol = NULL, col_legend_nrow = NULL, col_legend_rev = FALSE, col_palette = NULL, col_palette_na = NULL, col_rescale = scales::rescale(), col_steps = FALSE, col_transform = NULL, facet_axes = NULL, facet_axis_labels = "margins", facet_drop = FALSE, facet_labels = NULL, facet_layout = NULL, facet_ncol = NULL, facet_nrow = NULL, facet_scales = "fixed", facet_space = "fixed", title = NULL, subtitle = NULL, caption = NULL, label_case = NULL )
gg_contour_filled( data = NULL, ..., stat = "contour_filled", position = "identity", coord = ggplot2::coord_cartesian(clip = "off"), theme = NULL, theme_orientation = NULL, theme_axis_line_rm = NULL, theme_axis_ticks_rm = NULL, theme_panel_grid_rm = NULL, blend = NULL, x = NULL, xmin = NULL, xmax = NULL, xend = NULL, y = NULL, ymin = NULL, ymax = NULL, yend = NULL, z = NULL, col = NULL, facet = NULL, facet2 = NULL, group = NULL, subgroup = NULL, label = NULL, text = NULL, sample = NULL, mapping = NULL, x_breaks = NULL, x_breaks_n = NULL, x_expand = NULL, x_expand_limits = NULL, x_label = NULL, x_labels = NULL, x_position = "bottom", x_sec_axis = ggplot2::waiver(), x_symmetric = NULL, x_transform = NULL, y_breaks = NULL, y_breaks_n = NULL, y_expand = NULL, y_expand_limits = NULL, y_label = NULL, y_labels = NULL, y_position = "left", y_sec_axis = ggplot2::waiver(), y_symmetric = NULL, y_transform = NULL, col_breaks = NULL, col_breaks_n = 5, col_drop = FALSE, col_expand_limits = NULL, col_label = NULL, col_labels = NULL, col_legend_ncol = NULL, col_legend_nrow = NULL, col_legend_rev = FALSE, col_palette = NULL, col_palette_na = NULL, col_rescale = scales::rescale(), col_steps = FALSE, col_transform = NULL, facet_axes = NULL, facet_axis_labels = "margins", facet_drop = FALSE, facet_labels = NULL, facet_layout = NULL, facet_ncol = NULL, facet_nrow = NULL, facet_scales = "fixed", facet_space = "fixed", title = NULL, subtitle = NULL, caption = NULL, label_case = NULL )
data |
A data frame or tibble. |
... |
Other arguments passed to within a |
stat |
A statistical transformation to use on the data. A snakecase character string of a ggproto Stat subclass object minus the Stat prefix (e.g. |
position |
A position adjustment. A snakecase character string of a ggproto Position subclass object minus the Position prefix (e.g. |
coord |
A coordinate system. A |
theme |
A ggplot2 theme (e.g. |
theme_orientation |
The orientation of plot, which affects the theme components that are removed. Either |
theme_axis_line_rm |
|
theme_axis_ticks_rm |
|
theme_panel_grid_rm |
|
blend |
The blending mode per |
x , xmin , xmax , xend , y , ymin , ymax , yend , z , col , facet , facet2 , group , subgroup , label , text , sample
|
An unquoted aesthetic variable. |
mapping |
A set of additional aesthetic mappings in |
x_breaks , y_breaks , col_breaks
|
A |
x_breaks_n , y_breaks_n , col_breaks_n
|
A number of desired breaks for when |
x_expand , y_expand
|
Padding to the limits with the |
x_expand_limits , y_expand_limits , col_expand_limits
|
For a continuous variable, any values that the limits should encompass (e.g. |
x_label , y_label , col_label
|
Label for the axis or legend title. Use |
x_labels , y_labels , col_labels , facet_labels
|
A function that takes the breaks as inputs (e.g. |
x_position , y_position
|
The position of the axis (i.e. |
x_sec_axis , y_sec_axis
|
A secondary axis with |
x_symmetric , y_symmetric
|
|
x_transform , y_transform , col_transform
|
For a continuous scale, a transformation object (e.g. |
col_drop , facet_drop
|
For a discrete variable, FALSE or TRUE of whether to drop unused levels. |
col_legend_ncol , col_legend_nrow
|
The number of columns and rows in a legend guide. |
col_legend_rev |
|
col_palette |
A character vector of hex codes (or names) or a |
col_palette_na |
A hex code (or name) for the colour of |
col_rescale |
For a continuous variable, a |
col_steps |
For a continuous variable, |
facet_axes |
Whether to add interior axes and ticks with |
facet_axis_labels |
Whether to add interior axis labels with |
facet_layout |
Whether the layout is to be |
facet_ncol , facet_nrow
|
The number of columns and rows of facet panels. Only applies to a facet layout of |
facet_scales |
Whether facet scales should be |
facet_space |
When the facet scales are not |
title |
Title string. |
subtitle |
Subtitle string. |
caption |
Caption title string. |
label_case |
A function to format the label of unlabelled variables. Defaults to |
A ggplot object.
library(ggplot2) library(dplyr) set_blanket() faithfuld |> gg_contour_filled( x = waiting, y = eruptions, z = density, bins = 8, )
library(ggplot2) library(dplyr) set_blanket() faithfuld |> gg_contour_filled( x = waiting, y = eruptions, z = density, bins = 8, )
Create a crossbar ggplot with a wrapper around ggplot2::ggplot()
+ geom_crossbar().
gg_crossbar( data = NULL, ..., stat = "identity", position = "identity", coord = ggplot2::coord_cartesian(clip = "off"), theme = NULL, theme_orientation = NULL, theme_axis_line_rm = NULL, theme_axis_ticks_rm = NULL, theme_panel_grid_rm = NULL, blend = NULL, x = NULL, xmin = NULL, xmax = NULL, xend = NULL, y = NULL, ymin = NULL, ymax = NULL, yend = NULL, z = NULL, col = NULL, facet = NULL, facet2 = NULL, group = NULL, subgroup = NULL, label = NULL, text = NULL, sample = NULL, mapping = NULL, x_breaks = NULL, x_breaks_n = NULL, x_expand = NULL, x_expand_limits = NULL, x_label = NULL, x_labels = NULL, x_position = "bottom", x_sec_axis = ggplot2::waiver(), x_symmetric = NULL, x_transform = NULL, y_breaks = NULL, y_breaks_n = NULL, y_expand = NULL, y_expand_limits = NULL, y_label = NULL, y_labels = NULL, y_position = "left", y_sec_axis = ggplot2::waiver(), y_symmetric = NULL, y_transform = NULL, col_breaks = NULL, col_breaks_n = 5, col_drop = FALSE, col_expand_limits = NULL, col_label = NULL, col_labels = NULL, col_legend_ncol = NULL, col_legend_nrow = NULL, col_legend_rev = FALSE, col_palette = NULL, col_palette_na = NULL, col_rescale = scales::rescale(), col_steps = FALSE, col_transform = NULL, facet_axes = NULL, facet_axis_labels = "margins", facet_drop = FALSE, facet_labels = NULL, facet_layout = NULL, facet_ncol = NULL, facet_nrow = NULL, facet_scales = "fixed", facet_space = "fixed", title = NULL, subtitle = NULL, caption = NULL, label_case = NULL )
gg_crossbar( data = NULL, ..., stat = "identity", position = "identity", coord = ggplot2::coord_cartesian(clip = "off"), theme = NULL, theme_orientation = NULL, theme_axis_line_rm = NULL, theme_axis_ticks_rm = NULL, theme_panel_grid_rm = NULL, blend = NULL, x = NULL, xmin = NULL, xmax = NULL, xend = NULL, y = NULL, ymin = NULL, ymax = NULL, yend = NULL, z = NULL, col = NULL, facet = NULL, facet2 = NULL, group = NULL, subgroup = NULL, label = NULL, text = NULL, sample = NULL, mapping = NULL, x_breaks = NULL, x_breaks_n = NULL, x_expand = NULL, x_expand_limits = NULL, x_label = NULL, x_labels = NULL, x_position = "bottom", x_sec_axis = ggplot2::waiver(), x_symmetric = NULL, x_transform = NULL, y_breaks = NULL, y_breaks_n = NULL, y_expand = NULL, y_expand_limits = NULL, y_label = NULL, y_labels = NULL, y_position = "left", y_sec_axis = ggplot2::waiver(), y_symmetric = NULL, y_transform = NULL, col_breaks = NULL, col_breaks_n = 5, col_drop = FALSE, col_expand_limits = NULL, col_label = NULL, col_labels = NULL, col_legend_ncol = NULL, col_legend_nrow = NULL, col_legend_rev = FALSE, col_palette = NULL, col_palette_na = NULL, col_rescale = scales::rescale(), col_steps = FALSE, col_transform = NULL, facet_axes = NULL, facet_axis_labels = "margins", facet_drop = FALSE, facet_labels = NULL, facet_layout = NULL, facet_ncol = NULL, facet_nrow = NULL, facet_scales = "fixed", facet_space = "fixed", title = NULL, subtitle = NULL, caption = NULL, label_case = NULL )
data |
A data frame or tibble. |
... |
Other arguments passed to within a |
stat |
A statistical transformation to use on the data. A snakecase character string of a ggproto Stat subclass object minus the Stat prefix (e.g. |
position |
A position adjustment. A snakecase character string of a ggproto Position subclass object minus the Position prefix (e.g. |
coord |
A coordinate system. A |
theme |
A ggplot2 theme (e.g. |
theme_orientation |
The orientation of plot, which affects the theme components that are removed. Either |
theme_axis_line_rm |
|
theme_axis_ticks_rm |
|
theme_panel_grid_rm |
|
blend |
The blending mode per |
x , xmin , xmax , xend , y , ymin , ymax , yend , z , col , facet , facet2 , group , subgroup , label , text , sample
|
An unquoted aesthetic variable. |
mapping |
A set of additional aesthetic mappings in |
x_breaks , y_breaks , col_breaks
|
A |
x_breaks_n , y_breaks_n , col_breaks_n
|
A number of desired breaks for when |
x_expand , y_expand
|
Padding to the limits with the |
x_expand_limits , y_expand_limits , col_expand_limits
|
For a continuous variable, any values that the limits should encompass (e.g. |
x_label , y_label , col_label
|
Label for the axis or legend title. Use |
x_labels , y_labels , col_labels , facet_labels
|
A function that takes the breaks as inputs (e.g. |
x_position , y_position
|
The position of the axis (i.e. |
x_sec_axis , y_sec_axis
|
A secondary axis with |
x_symmetric , y_symmetric
|
|
x_transform , y_transform , col_transform
|
For a continuous scale, a transformation object (e.g. |
col_drop , facet_drop
|
For a discrete variable, FALSE or TRUE of whether to drop unused levels. |
col_legend_ncol , col_legend_nrow
|
The number of columns and rows in a legend guide. |
col_legend_rev |
|
col_palette |
A character vector of hex codes (or names) or a |
col_palette_na |
A hex code (or name) for the colour of |
col_rescale |
For a continuous variable, a |
col_steps |
For a continuous variable, |
facet_axes |
Whether to add interior axes and ticks with |
facet_axis_labels |
Whether to add interior axis labels with |
facet_layout |
Whether the layout is to be |
facet_ncol , facet_nrow
|
The number of columns and rows of facet panels. Only applies to a facet layout of |
facet_scales |
Whether facet scales should be |
facet_space |
When the facet scales are not |
title |
Title string. |
subtitle |
Subtitle string. |
caption |
Caption title string. |
label_case |
A function to format the label of unlabelled variables. Defaults to |
A ggplot object.
library(ggplot2) library(dplyr) set_blanket() data.frame( trt = factor(c(1, 1, 2, 2)), resp = c(1, 5, 3, 4), group = factor(c(1, 2, 1, 2)), upper = c(1.1, 5.3, 3.3, 4.2), lower = c(0.8, 4.6, 2.4, 3.6) ) |> gg_crossbar( x = trt, y = resp, ymin = lower, ymax = upper, col = group, width = 0.5, x_label = "Treatment", y_label = "Response", blend = "multiply", )
library(ggplot2) library(dplyr) set_blanket() data.frame( trt = factor(c(1, 1, 2, 2)), resp = c(1, 5, 3, 4), group = factor(c(1, 2, 1, 2)), upper = c(1.1, 5.3, 3.3, 4.2), lower = c(0.8, 4.6, 2.4, 3.6) ) |> gg_crossbar( x = trt, y = resp, ymin = lower, ymax = upper, col = group, width = 0.5, x_label = "Treatment", y_label = "Response", blend = "multiply", )
Create a density ggplot with a wrapper around ggplot2::ggplot()
+ geom_density().
gg_density( data = NULL, ..., stat = "density", position = "identity", coord = ggplot2::coord_cartesian(clip = "off"), theme = NULL, theme_orientation = NULL, theme_axis_line_rm = NULL, theme_axis_ticks_rm = NULL, theme_panel_grid_rm = NULL, blend = NULL, x = NULL, xmin = NULL, xmax = NULL, xend = NULL, y = NULL, ymin = NULL, ymax = NULL, yend = NULL, z = NULL, col = NULL, facet = NULL, facet2 = NULL, group = NULL, subgroup = NULL, label = NULL, text = NULL, sample = NULL, mapping = NULL, x_breaks = NULL, x_breaks_n = NULL, x_expand = NULL, x_expand_limits = NULL, x_label = NULL, x_labels = NULL, x_position = "bottom", x_sec_axis = ggplot2::waiver(), x_symmetric = NULL, x_transform = NULL, y_breaks = NULL, y_breaks_n = NULL, y_expand = NULL, y_expand_limits = NULL, y_label = NULL, y_labels = NULL, y_position = "left", y_sec_axis = ggplot2::waiver(), y_symmetric = NULL, y_transform = NULL, col_breaks = NULL, col_breaks_n = 5, col_drop = FALSE, col_expand_limits = NULL, col_label = NULL, col_labels = NULL, col_legend_ncol = NULL, col_legend_nrow = NULL, col_legend_rev = FALSE, col_palette = NULL, col_palette_na = NULL, col_rescale = scales::rescale(), col_steps = FALSE, col_transform = NULL, facet_axes = NULL, facet_axis_labels = "margins", facet_drop = FALSE, facet_labels = NULL, facet_layout = NULL, facet_ncol = NULL, facet_nrow = NULL, facet_scales = "fixed", facet_space = "fixed", title = NULL, subtitle = NULL, caption = NULL, label_case = NULL )
gg_density( data = NULL, ..., stat = "density", position = "identity", coord = ggplot2::coord_cartesian(clip = "off"), theme = NULL, theme_orientation = NULL, theme_axis_line_rm = NULL, theme_axis_ticks_rm = NULL, theme_panel_grid_rm = NULL, blend = NULL, x = NULL, xmin = NULL, xmax = NULL, xend = NULL, y = NULL, ymin = NULL, ymax = NULL, yend = NULL, z = NULL, col = NULL, facet = NULL, facet2 = NULL, group = NULL, subgroup = NULL, label = NULL, text = NULL, sample = NULL, mapping = NULL, x_breaks = NULL, x_breaks_n = NULL, x_expand = NULL, x_expand_limits = NULL, x_label = NULL, x_labels = NULL, x_position = "bottom", x_sec_axis = ggplot2::waiver(), x_symmetric = NULL, x_transform = NULL, y_breaks = NULL, y_breaks_n = NULL, y_expand = NULL, y_expand_limits = NULL, y_label = NULL, y_labels = NULL, y_position = "left", y_sec_axis = ggplot2::waiver(), y_symmetric = NULL, y_transform = NULL, col_breaks = NULL, col_breaks_n = 5, col_drop = FALSE, col_expand_limits = NULL, col_label = NULL, col_labels = NULL, col_legend_ncol = NULL, col_legend_nrow = NULL, col_legend_rev = FALSE, col_palette = NULL, col_palette_na = NULL, col_rescale = scales::rescale(), col_steps = FALSE, col_transform = NULL, facet_axes = NULL, facet_axis_labels = "margins", facet_drop = FALSE, facet_labels = NULL, facet_layout = NULL, facet_ncol = NULL, facet_nrow = NULL, facet_scales = "fixed", facet_space = "fixed", title = NULL, subtitle = NULL, caption = NULL, label_case = NULL )
data |
A data frame or tibble. |
... |
Other arguments passed to within a |
stat |
A statistical transformation to use on the data. A snakecase character string of a ggproto Stat subclass object minus the Stat prefix (e.g. |
position |
A position adjustment. A snakecase character string of a ggproto Position subclass object minus the Position prefix (e.g. |
coord |
A coordinate system. A |
theme |
A ggplot2 theme (e.g. |
theme_orientation |
The orientation of plot, which affects the theme components that are removed. Either |
theme_axis_line_rm |
|
theme_axis_ticks_rm |
|
theme_panel_grid_rm |
|
blend |
The blending mode per |
x , xmin , xmax , xend , y , ymin , ymax , yend , z , col , facet , facet2 , group , subgroup , label , text , sample
|
An unquoted aesthetic variable. |
mapping |
A set of additional aesthetic mappings in |
x_breaks , y_breaks , col_breaks
|
A |
x_breaks_n , y_breaks_n , col_breaks_n
|
A number of desired breaks for when |
x_expand , y_expand
|
Padding to the limits with the |
x_expand_limits , y_expand_limits , col_expand_limits
|
For a continuous variable, any values that the limits should encompass (e.g. |
x_label , y_label , col_label
|
Label for the axis or legend title. Use |
x_labels , y_labels , col_labels , facet_labels
|
A function that takes the breaks as inputs (e.g. |
x_position , y_position
|
The position of the axis (i.e. |
x_sec_axis , y_sec_axis
|
A secondary axis with |
x_symmetric , y_symmetric
|
|
x_transform , y_transform , col_transform
|
For a continuous scale, a transformation object (e.g. |
col_drop , facet_drop
|
For a discrete variable, FALSE or TRUE of whether to drop unused levels. |
col_legend_ncol , col_legend_nrow
|
The number of columns and rows in a legend guide. |
col_legend_rev |
|
col_palette |
A character vector of hex codes (or names) or a |
col_palette_na |
A hex code (or name) for the colour of |
col_rescale |
For a continuous variable, a |
col_steps |
For a continuous variable, |
facet_axes |
Whether to add interior axes and ticks with |
facet_axis_labels |
Whether to add interior axis labels with |
facet_layout |
Whether the layout is to be |
facet_ncol , facet_nrow
|
The number of columns and rows of facet panels. Only applies to a facet layout of |
facet_scales |
Whether facet scales should be |
facet_space |
When the facet scales are not |
title |
Title string. |
subtitle |
Subtitle string. |
caption |
Caption title string. |
label_case |
A function to format the label of unlabelled variables. Defaults to |
A ggplot object.
library(ggplot2) library(dplyr) library(palmerpenguins) set_blanket() penguins |> gg_density( x = flipper_length_mm, col = species, blend = "multiply", )
library(ggplot2) library(dplyr) library(palmerpenguins) set_blanket() penguins |> gg_density( x = flipper_length_mm, col = species, blend = "multiply", )
Create a density_2d ggplot with a wrapper around ggplot2::ggplot()
+ geom_density_2d().
gg_density_2d( data = NULL, ..., stat = "density_2d", position = "identity", coord = ggplot2::coord_cartesian(clip = "off"), theme = NULL, theme_orientation = NULL, theme_axis_line_rm = NULL, theme_axis_ticks_rm = NULL, theme_panel_grid_rm = NULL, blend = NULL, x = NULL, xmin = NULL, xmax = NULL, xend = NULL, y = NULL, ymin = NULL, ymax = NULL, yend = NULL, z = NULL, col = NULL, facet = NULL, facet2 = NULL, group = NULL, subgroup = NULL, label = NULL, text = NULL, sample = NULL, mapping = NULL, x_breaks = NULL, x_breaks_n = NULL, x_expand = NULL, x_expand_limits = NULL, x_label = NULL, x_labels = NULL, x_position = "bottom", x_sec_axis = ggplot2::waiver(), x_symmetric = NULL, x_transform = NULL, y_breaks = NULL, y_breaks_n = NULL, y_expand = NULL, y_expand_limits = NULL, y_label = NULL, y_labels = NULL, y_position = "left", y_sec_axis = ggplot2::waiver(), y_symmetric = NULL, y_transform = NULL, col_breaks = NULL, col_breaks_n = 5, col_drop = FALSE, col_expand_limits = NULL, col_label = NULL, col_labels = NULL, col_legend_ncol = NULL, col_legend_nrow = NULL, col_legend_rev = FALSE, col_palette = NULL, col_palette_na = NULL, col_rescale = scales::rescale(), col_steps = FALSE, col_transform = NULL, facet_axes = NULL, facet_axis_labels = "margins", facet_drop = FALSE, facet_labels = NULL, facet_layout = NULL, facet_ncol = NULL, facet_nrow = NULL, facet_scales = "fixed", facet_space = "fixed", title = NULL, subtitle = NULL, caption = NULL, label_case = NULL )
gg_density_2d( data = NULL, ..., stat = "density_2d", position = "identity", coord = ggplot2::coord_cartesian(clip = "off"), theme = NULL, theme_orientation = NULL, theme_axis_line_rm = NULL, theme_axis_ticks_rm = NULL, theme_panel_grid_rm = NULL, blend = NULL, x = NULL, xmin = NULL, xmax = NULL, xend = NULL, y = NULL, ymin = NULL, ymax = NULL, yend = NULL, z = NULL, col = NULL, facet = NULL, facet2 = NULL, group = NULL, subgroup = NULL, label = NULL, text = NULL, sample = NULL, mapping = NULL, x_breaks = NULL, x_breaks_n = NULL, x_expand = NULL, x_expand_limits = NULL, x_label = NULL, x_labels = NULL, x_position = "bottom", x_sec_axis = ggplot2::waiver(), x_symmetric = NULL, x_transform = NULL, y_breaks = NULL, y_breaks_n = NULL, y_expand = NULL, y_expand_limits = NULL, y_label = NULL, y_labels = NULL, y_position = "left", y_sec_axis = ggplot2::waiver(), y_symmetric = NULL, y_transform = NULL, col_breaks = NULL, col_breaks_n = 5, col_drop = FALSE, col_expand_limits = NULL, col_label = NULL, col_labels = NULL, col_legend_ncol = NULL, col_legend_nrow = NULL, col_legend_rev = FALSE, col_palette = NULL, col_palette_na = NULL, col_rescale = scales::rescale(), col_steps = FALSE, col_transform = NULL, facet_axes = NULL, facet_axis_labels = "margins", facet_drop = FALSE, facet_labels = NULL, facet_layout = NULL, facet_ncol = NULL, facet_nrow = NULL, facet_scales = "fixed", facet_space = "fixed", title = NULL, subtitle = NULL, caption = NULL, label_case = NULL )
data |
A data frame or tibble. |
... |
Other arguments passed to within a |
stat |
A statistical transformation to use on the data. A snakecase character string of a ggproto Stat subclass object minus the Stat prefix (e.g. |
position |
A position adjustment. A snakecase character string of a ggproto Position subclass object minus the Position prefix (e.g. |
coord |
A coordinate system. A |
theme |
A ggplot2 theme (e.g. |
theme_orientation |
The orientation of plot, which affects the theme components that are removed. Either |
theme_axis_line_rm |
|
theme_axis_ticks_rm |
|
theme_panel_grid_rm |
|
blend |
The blending mode per |
x , xmin , xmax , xend , y , ymin , ymax , yend , z , col , facet , facet2 , group , subgroup , label , text , sample
|
An unquoted aesthetic variable. |
mapping |
A set of additional aesthetic mappings in |
x_breaks , y_breaks , col_breaks
|
A |
x_breaks_n , y_breaks_n , col_breaks_n
|
A number of desired breaks for when |
x_expand , y_expand
|
Padding to the limits with the |
x_expand_limits , y_expand_limits , col_expand_limits
|
For a continuous variable, any values that the limits should encompass (e.g. |
x_label , y_label , col_label
|
Label for the axis or legend title. Use |
x_labels , y_labels , col_labels , facet_labels
|
A function that takes the breaks as inputs (e.g. |
x_position , y_position
|
The position of the axis (i.e. |
x_sec_axis , y_sec_axis
|
A secondary axis with |
x_symmetric , y_symmetric
|
|
x_transform , y_transform , col_transform
|
For a continuous scale, a transformation object (e.g. |
col_drop , facet_drop
|
For a discrete variable, FALSE or TRUE of whether to drop unused levels. |
col_legend_ncol , col_legend_nrow
|
The number of columns and rows in a legend guide. |
col_legend_rev |
|
col_palette |
A character vector of hex codes (or names) or a |
col_palette_na |
A hex code (or name) for the colour of |
col_rescale |
For a continuous variable, a |
col_steps |
For a continuous variable, |
facet_axes |
Whether to add interior axes and ticks with |
facet_axis_labels |
Whether to add interior axis labels with |
facet_layout |
Whether the layout is to be |
facet_ncol , facet_nrow
|
The number of columns and rows of facet panels. Only applies to a facet layout of |
facet_scales |
Whether facet scales should be |
facet_space |
When the facet scales are not |
title |
Title string. |
subtitle |
Subtitle string. |
caption |
Caption title string. |
label_case |
A function to format the label of unlabelled variables. Defaults to |
A ggplot object.
library(ggplot2) library(dplyr) library(palmerpenguins) set_blanket() faithful |> gg_density_2d( x = waiting, y = eruptions, bins = 8, contour = TRUE, )
library(ggplot2) library(dplyr) library(palmerpenguins) set_blanket() faithful |> gg_density_2d( x = waiting, y = eruptions, bins = 8, contour = TRUE, )
Create a density_2d_filled ggplot with a wrapper around ggplot2::ggplot()
+ geom_density_2d_filled().
gg_density_2d_filled( data = NULL, ..., stat = "density_2d_filled", position = "identity", coord = ggplot2::coord_cartesian(clip = "off"), theme = NULL, theme_orientation = NULL, theme_axis_line_rm = NULL, theme_axis_ticks_rm = NULL, theme_panel_grid_rm = NULL, blend = NULL, x = NULL, xmin = NULL, xmax = NULL, xend = NULL, y = NULL, ymin = NULL, ymax = NULL, yend = NULL, z = NULL, col = NULL, facet = NULL, facet2 = NULL, group = NULL, subgroup = NULL, label = NULL, text = NULL, sample = NULL, mapping = NULL, x_breaks = NULL, x_breaks_n = NULL, x_expand = NULL, x_expand_limits = NULL, x_label = NULL, x_labels = NULL, x_position = "bottom", x_sec_axis = ggplot2::waiver(), x_symmetric = NULL, x_transform = NULL, y_breaks = NULL, y_breaks_n = NULL, y_expand = NULL, y_expand_limits = NULL, y_label = NULL, y_labels = NULL, y_position = "left", y_sec_axis = ggplot2::waiver(), y_symmetric = NULL, y_transform = NULL, col_breaks = NULL, col_breaks_n = 5, col_drop = FALSE, col_expand_limits = NULL, col_label = NULL, col_labels = NULL, col_legend_ncol = NULL, col_legend_nrow = NULL, col_legend_rev = FALSE, col_palette = NULL, col_palette_na = NULL, col_rescale = scales::rescale(), col_steps = FALSE, col_transform = NULL, facet_axes = NULL, facet_axis_labels = "margins", facet_drop = FALSE, facet_labels = NULL, facet_layout = NULL, facet_ncol = NULL, facet_nrow = NULL, facet_scales = "fixed", facet_space = "fixed", title = NULL, subtitle = NULL, caption = NULL, label_case = NULL )
gg_density_2d_filled( data = NULL, ..., stat = "density_2d_filled", position = "identity", coord = ggplot2::coord_cartesian(clip = "off"), theme = NULL, theme_orientation = NULL, theme_axis_line_rm = NULL, theme_axis_ticks_rm = NULL, theme_panel_grid_rm = NULL, blend = NULL, x = NULL, xmin = NULL, xmax = NULL, xend = NULL, y = NULL, ymin = NULL, ymax = NULL, yend = NULL, z = NULL, col = NULL, facet = NULL, facet2 = NULL, group = NULL, subgroup = NULL, label = NULL, text = NULL, sample = NULL, mapping = NULL, x_breaks = NULL, x_breaks_n = NULL, x_expand = NULL, x_expand_limits = NULL, x_label = NULL, x_labels = NULL, x_position = "bottom", x_sec_axis = ggplot2::waiver(), x_symmetric = NULL, x_transform = NULL, y_breaks = NULL, y_breaks_n = NULL, y_expand = NULL, y_expand_limits = NULL, y_label = NULL, y_labels = NULL, y_position = "left", y_sec_axis = ggplot2::waiver(), y_symmetric = NULL, y_transform = NULL, col_breaks = NULL, col_breaks_n = 5, col_drop = FALSE, col_expand_limits = NULL, col_label = NULL, col_labels = NULL, col_legend_ncol = NULL, col_legend_nrow = NULL, col_legend_rev = FALSE, col_palette = NULL, col_palette_na = NULL, col_rescale = scales::rescale(), col_steps = FALSE, col_transform = NULL, facet_axes = NULL, facet_axis_labels = "margins", facet_drop = FALSE, facet_labels = NULL, facet_layout = NULL, facet_ncol = NULL, facet_nrow = NULL, facet_scales = "fixed", facet_space = "fixed", title = NULL, subtitle = NULL, caption = NULL, label_case = NULL )
data |
A data frame or tibble. |
... |
Other arguments passed to within a |
stat |
A statistical transformation to use on the data. A snakecase character string of a ggproto Stat subclass object minus the Stat prefix (e.g. |
position |
A position adjustment. A snakecase character string of a ggproto Position subclass object minus the Position prefix (e.g. |
coord |
A coordinate system. A |
theme |
A ggplot2 theme (e.g. |
theme_orientation |
The orientation of plot, which affects the theme components that are removed. Either |
theme_axis_line_rm |
|
theme_axis_ticks_rm |
|
theme_panel_grid_rm |
|
blend |
The blending mode per |
x , xmin , xmax , xend , y , ymin , ymax , yend , z , col , facet , facet2 , group , subgroup , label , text , sample
|
An unquoted aesthetic variable. |
mapping |
A set of additional aesthetic mappings in |
x_breaks , y_breaks , col_breaks
|
A |
x_breaks_n , y_breaks_n , col_breaks_n
|
A number of desired breaks for when |
x_expand , y_expand
|
Padding to the limits with the |
x_expand_limits , y_expand_limits , col_expand_limits
|
For a continuous variable, any values that the limits should encompass (e.g. |
x_label , y_label , col_label
|
Label for the axis or legend title. Use |
x_labels , y_labels , col_labels , facet_labels
|
A function that takes the breaks as inputs (e.g. |
x_position , y_position
|
The position of the axis (i.e. |
x_sec_axis , y_sec_axis
|
A secondary axis with |
x_symmetric , y_symmetric
|
|
x_transform , y_transform , col_transform
|
For a continuous scale, a transformation object (e.g. |
col_drop , facet_drop
|
For a discrete variable, FALSE or TRUE of whether to drop unused levels. |
col_legend_ncol , col_legend_nrow
|
The number of columns and rows in a legend guide. |
col_legend_rev |
|
col_palette |
A character vector of hex codes (or names) or a |
col_palette_na |
A hex code (or name) for the colour of |
col_rescale |
For a continuous variable, a |
col_steps |
For a continuous variable, |
facet_axes |
Whether to add interior axes and ticks with |
facet_axis_labels |
Whether to add interior axis labels with |
facet_layout |
Whether the layout is to be |
facet_ncol , facet_nrow
|
The number of columns and rows of facet panels. Only applies to a facet layout of |
facet_scales |
Whether facet scales should be |
facet_space |
When the facet scales are not |
title |
Title string. |
subtitle |
Subtitle string. |
caption |
Caption title string. |
label_case |
A function to format the label of unlabelled variables. Defaults to |
A ggplot object.
library(ggplot2) library(dplyr) library(palmerpenguins) set_blanket() faithful |> gg_density_2d_filled( x = waiting, y = eruptions, bins = 8, contour = TRUE, )
library(ggplot2) library(dplyr) library(palmerpenguins) set_blanket() faithful |> gg_density_2d_filled( x = waiting, y = eruptions, bins = 8, contour = TRUE, )
Create a errorbar ggplot with a wrapper around ggplot2::ggplot()
+ geom_errorbar().
gg_errorbar( data = NULL, ..., stat = "identity", position = "identity", coord = ggplot2::coord_cartesian(clip = "off"), theme = NULL, theme_orientation = NULL, theme_axis_line_rm = NULL, theme_axis_ticks_rm = NULL, theme_panel_grid_rm = NULL, blend = NULL, x = NULL, xmin = NULL, xmax = NULL, xend = NULL, y = NULL, ymin = NULL, ymax = NULL, yend = NULL, z = NULL, col = NULL, facet = NULL, facet2 = NULL, group = NULL, subgroup = NULL, label = NULL, text = NULL, sample = NULL, mapping = NULL, x_breaks = NULL, x_breaks_n = NULL, x_expand = NULL, x_expand_limits = NULL, x_label = NULL, x_labels = NULL, x_position = "bottom", x_sec_axis = ggplot2::waiver(), x_symmetric = NULL, x_transform = NULL, y_breaks = NULL, y_breaks_n = NULL, y_expand = NULL, y_expand_limits = NULL, y_label = NULL, y_labels = NULL, y_position = "left", y_sec_axis = ggplot2::waiver(), y_symmetric = NULL, y_transform = NULL, col_breaks = NULL, col_breaks_n = 5, col_drop = FALSE, col_expand_limits = NULL, col_label = NULL, col_labels = NULL, col_legend_ncol = NULL, col_legend_nrow = NULL, col_legend_rev = FALSE, col_palette = NULL, col_palette_na = NULL, col_rescale = scales::rescale(), col_steps = FALSE, col_transform = NULL, facet_axes = NULL, facet_axis_labels = "margins", facet_drop = FALSE, facet_labels = NULL, facet_layout = NULL, facet_ncol = NULL, facet_nrow = NULL, facet_scales = "fixed", facet_space = "fixed", title = NULL, subtitle = NULL, caption = NULL, label_case = NULL )
gg_errorbar( data = NULL, ..., stat = "identity", position = "identity", coord = ggplot2::coord_cartesian(clip = "off"), theme = NULL, theme_orientation = NULL, theme_axis_line_rm = NULL, theme_axis_ticks_rm = NULL, theme_panel_grid_rm = NULL, blend = NULL, x = NULL, xmin = NULL, xmax = NULL, xend = NULL, y = NULL, ymin = NULL, ymax = NULL, yend = NULL, z = NULL, col = NULL, facet = NULL, facet2 = NULL, group = NULL, subgroup = NULL, label = NULL, text = NULL, sample = NULL, mapping = NULL, x_breaks = NULL, x_breaks_n = NULL, x_expand = NULL, x_expand_limits = NULL, x_label = NULL, x_labels = NULL, x_position = "bottom", x_sec_axis = ggplot2::waiver(), x_symmetric = NULL, x_transform = NULL, y_breaks = NULL, y_breaks_n = NULL, y_expand = NULL, y_expand_limits = NULL, y_label = NULL, y_labels = NULL, y_position = "left", y_sec_axis = ggplot2::waiver(), y_symmetric = NULL, y_transform = NULL, col_breaks = NULL, col_breaks_n = 5, col_drop = FALSE, col_expand_limits = NULL, col_label = NULL, col_labels = NULL, col_legend_ncol = NULL, col_legend_nrow = NULL, col_legend_rev = FALSE, col_palette = NULL, col_palette_na = NULL, col_rescale = scales::rescale(), col_steps = FALSE, col_transform = NULL, facet_axes = NULL, facet_axis_labels = "margins", facet_drop = FALSE, facet_labels = NULL, facet_layout = NULL, facet_ncol = NULL, facet_nrow = NULL, facet_scales = "fixed", facet_space = "fixed", title = NULL, subtitle = NULL, caption = NULL, label_case = NULL )
data |
A data frame or tibble. |
... |
Other arguments passed to within a |
stat |
A statistical transformation to use on the data. A snakecase character string of a ggproto Stat subclass object minus the Stat prefix (e.g. |
position |
A position adjustment. A snakecase character string of a ggproto Position subclass object minus the Position prefix (e.g. |
coord |
A coordinate system. A |
theme |
A ggplot2 theme (e.g. |
theme_orientation |
The orientation of plot, which affects the theme components that are removed. Either |
theme_axis_line_rm |
|
theme_axis_ticks_rm |
|
theme_panel_grid_rm |
|
blend |
The blending mode per |
x , xmin , xmax , xend , y , ymin , ymax , yend , z , col , facet , facet2 , group , subgroup , label , text , sample
|
An unquoted aesthetic variable. |
mapping |
A set of additional aesthetic mappings in |
x_breaks , y_breaks , col_breaks
|
A |
x_breaks_n , y_breaks_n , col_breaks_n
|
A number of desired breaks for when |
x_expand , y_expand
|
Padding to the limits with the |
x_expand_limits , y_expand_limits , col_expand_limits
|
For a continuous variable, any values that the limits should encompass (e.g. |
x_label , y_label , col_label
|
Label for the axis or legend title. Use |
x_labels , y_labels , col_labels , facet_labels
|
A function that takes the breaks as inputs (e.g. |
x_position , y_position
|
The position of the axis (i.e. |
x_sec_axis , y_sec_axis
|
A secondary axis with |
x_symmetric , y_symmetric
|
|
x_transform , y_transform , col_transform
|
For a continuous scale, a transformation object (e.g. |
col_drop , facet_drop
|
For a discrete variable, FALSE or TRUE of whether to drop unused levels. |
col_legend_ncol , col_legend_nrow
|
The number of columns and rows in a legend guide. |
col_legend_rev |
|
col_palette |
A character vector of hex codes (or names) or a |
col_palette_na |
A hex code (or name) for the colour of |
col_rescale |
For a continuous variable, a |
col_steps |
For a continuous variable, |
facet_axes |
Whether to add interior axes and ticks with |
facet_axis_labels |
Whether to add interior axis labels with |
facet_layout |
Whether the layout is to be |
facet_ncol , facet_nrow
|
The number of columns and rows of facet panels. Only applies to a facet layout of |
facet_scales |
Whether facet scales should be |
facet_space |
When the facet scales are not |
title |
Title string. |
subtitle |
Subtitle string. |
caption |
Caption title string. |
label_case |
A function to format the label of unlabelled variables. Defaults to |
A ggplot object.
library(ggplot2) library(dplyr) library(palmerpenguins) set_blanket() data.frame( trt = factor(c(1, 1, 2, 2)), resp = c(1, 5, 3, 4), group = factor(c(1, 2, 1, 2)), upper = c(1.1, 5.3, 3.3, 4.2), lower = c(0.8, 4.6, 2.4, 3.6) ) |> gg_errorbar( x = trt, ymin = lower, ymax = upper, col = group, width = 0.1, x_label = "Treatment", y_label = "Response", )
library(ggplot2) library(dplyr) library(palmerpenguins) set_blanket() data.frame( trt = factor(c(1, 1, 2, 2)), resp = c(1, 5, 3, 4), group = factor(c(1, 2, 1, 2)), upper = c(1.1, 5.3, 3.3, 4.2), lower = c(0.8, 4.6, 2.4, 3.6) ) |> gg_errorbar( x = trt, ymin = lower, ymax = upper, col = group, width = 0.1, x_label = "Treatment", y_label = "Response", )
Create a freqpoly ggplot with a wrapper around ggplot2::ggplot()
+ geom_freqpoly().
gg_freqpoly( data = NULL, ..., stat = "bin", position = "identity", coord = ggplot2::coord_cartesian(clip = "off"), theme = NULL, theme_orientation = NULL, theme_axis_line_rm = NULL, theme_axis_ticks_rm = NULL, theme_panel_grid_rm = NULL, blend = NULL, x = NULL, xmin = NULL, xmax = NULL, xend = NULL, y = NULL, ymin = NULL, ymax = NULL, yend = NULL, z = NULL, col = NULL, facet = NULL, facet2 = NULL, group = NULL, subgroup = NULL, label = NULL, text = NULL, sample = NULL, mapping = NULL, x_breaks = NULL, x_breaks_n = NULL, x_expand = NULL, x_expand_limits = NULL, x_label = NULL, x_labels = NULL, x_position = "bottom", x_sec_axis = ggplot2::waiver(), x_symmetric = NULL, x_transform = NULL, y_breaks = NULL, y_breaks_n = NULL, y_expand = NULL, y_expand_limits = NULL, y_label = NULL, y_labels = NULL, y_position = "left", y_sec_axis = ggplot2::waiver(), y_symmetric = NULL, y_transform = NULL, col_breaks = NULL, col_breaks_n = 5, col_drop = FALSE, col_expand_limits = NULL, col_label = NULL, col_labels = NULL, col_legend_ncol = NULL, col_legend_nrow = NULL, col_legend_rev = FALSE, col_palette = NULL, col_palette_na = NULL, col_rescale = scales::rescale(), col_steps = FALSE, col_transform = NULL, facet_axes = NULL, facet_axis_labels = "margins", facet_drop = FALSE, facet_labels = NULL, facet_layout = NULL, facet_ncol = NULL, facet_nrow = NULL, facet_scales = "fixed", facet_space = "fixed", title = NULL, subtitle = NULL, caption = NULL, label_case = NULL )
gg_freqpoly( data = NULL, ..., stat = "bin", position = "identity", coord = ggplot2::coord_cartesian(clip = "off"), theme = NULL, theme_orientation = NULL, theme_axis_line_rm = NULL, theme_axis_ticks_rm = NULL, theme_panel_grid_rm = NULL, blend = NULL, x = NULL, xmin = NULL, xmax = NULL, xend = NULL, y = NULL, ymin = NULL, ymax = NULL, yend = NULL, z = NULL, col = NULL, facet = NULL, facet2 = NULL, group = NULL, subgroup = NULL, label = NULL, text = NULL, sample = NULL, mapping = NULL, x_breaks = NULL, x_breaks_n = NULL, x_expand = NULL, x_expand_limits = NULL, x_label = NULL, x_labels = NULL, x_position = "bottom", x_sec_axis = ggplot2::waiver(), x_symmetric = NULL, x_transform = NULL, y_breaks = NULL, y_breaks_n = NULL, y_expand = NULL, y_expand_limits = NULL, y_label = NULL, y_labels = NULL, y_position = "left", y_sec_axis = ggplot2::waiver(), y_symmetric = NULL, y_transform = NULL, col_breaks = NULL, col_breaks_n = 5, col_drop = FALSE, col_expand_limits = NULL, col_label = NULL, col_labels = NULL, col_legend_ncol = NULL, col_legend_nrow = NULL, col_legend_rev = FALSE, col_palette = NULL, col_palette_na = NULL, col_rescale = scales::rescale(), col_steps = FALSE, col_transform = NULL, facet_axes = NULL, facet_axis_labels = "margins", facet_drop = FALSE, facet_labels = NULL, facet_layout = NULL, facet_ncol = NULL, facet_nrow = NULL, facet_scales = "fixed", facet_space = "fixed", title = NULL, subtitle = NULL, caption = NULL, label_case = NULL )
data |
A data frame or tibble. |
... |
Other arguments passed to within a |
stat |
A statistical transformation to use on the data. A snakecase character string of a ggproto Stat subclass object minus the Stat prefix (e.g. |
position |
A position adjustment. A snakecase character string of a ggproto Position subclass object minus the Position prefix (e.g. |
coord |
A coordinate system. A |
theme |
A ggplot2 theme (e.g. |
theme_orientation |
The orientation of plot, which affects the theme components that are removed. Either |
theme_axis_line_rm |
|
theme_axis_ticks_rm |
|
theme_panel_grid_rm |
|
blend |
The blending mode per |
x , xmin , xmax , xend , y , ymin , ymax , yend , z , col , facet , facet2 , group , subgroup , label , text , sample
|
An unquoted aesthetic variable. |
mapping |
A set of additional aesthetic mappings in |
x_breaks , y_breaks , col_breaks
|
A |
x_breaks_n , y_breaks_n , col_breaks_n
|
A number of desired breaks for when |
x_expand , y_expand
|
Padding to the limits with the |
x_expand_limits , y_expand_limits , col_expand_limits
|
For a continuous variable, any values that the limits should encompass (e.g. |
x_label , y_label , col_label
|
Label for the axis or legend title. Use |
x_labels , y_labels , col_labels , facet_labels
|
A function that takes the breaks as inputs (e.g. |
x_position , y_position
|
The position of the axis (i.e. |
x_sec_axis , y_sec_axis
|
A secondary axis with |
x_symmetric , y_symmetric
|
|
x_transform , y_transform , col_transform
|
For a continuous scale, a transformation object (e.g. |
col_drop , facet_drop
|
For a discrete variable, FALSE or TRUE of whether to drop unused levels. |
col_legend_ncol , col_legend_nrow
|
The number of columns and rows in a legend guide. |
col_legend_rev |
|
col_palette |
A character vector of hex codes (or names) or a |
col_palette_na |
A hex code (or name) for the colour of |
col_rescale |
For a continuous variable, a |
col_steps |
For a continuous variable, |
facet_axes |
Whether to add interior axes and ticks with |
facet_axis_labels |
Whether to add interior axis labels with |
facet_layout |
Whether the layout is to be |
facet_ncol , facet_nrow
|
The number of columns and rows of facet panels. Only applies to a facet layout of |
facet_scales |
Whether facet scales should be |
facet_space |
When the facet scales are not |
title |
Title string. |
subtitle |
Subtitle string. |
caption |
Caption title string. |
label_case |
A function to format the label of unlabelled variables. Defaults to |
A ggplot object.
library(ggplot2) library(dplyr) library(palmerpenguins) set_blanket() penguins |> gg_freqpoly( x = flipper_length_mm, col = sex, )
library(ggplot2) library(dplyr) library(palmerpenguins) set_blanket() penguins |> gg_freqpoly( x = flipper_length_mm, col = sex, )
Create a function ggplot with a wrapper around ggplot2::ggplot()
+ geom_function().
gg_function( data = NULL, ..., stat = "function", position = "identity", coord = ggplot2::coord_cartesian(clip = "off"), theme = NULL, theme_orientation = NULL, theme_axis_line_rm = NULL, theme_axis_ticks_rm = NULL, theme_panel_grid_rm = NULL, blend = NULL, x = NULL, xmin = NULL, xmax = NULL, xend = NULL, y = NULL, ymin = NULL, ymax = NULL, yend = NULL, z = NULL, col = NULL, facet = NULL, facet2 = NULL, group = NULL, subgroup = NULL, label = NULL, text = NULL, sample = NULL, mapping = NULL, x_breaks = NULL, x_breaks_n = NULL, x_expand = NULL, x_expand_limits = NULL, x_label = NULL, x_labels = NULL, x_position = "bottom", x_sec_axis = ggplot2::waiver(), x_symmetric = NULL, x_transform = NULL, y_breaks = NULL, y_breaks_n = NULL, y_expand = NULL, y_expand_limits = NULL, y_label = NULL, y_labels = NULL, y_position = "left", y_sec_axis = ggplot2::waiver(), y_symmetric = NULL, y_transform = NULL, col_breaks = NULL, col_breaks_n = 5, col_drop = FALSE, col_expand_limits = NULL, col_label = NULL, col_labels = NULL, col_legend_ncol = NULL, col_legend_nrow = NULL, col_legend_rev = FALSE, col_palette = NULL, col_palette_na = NULL, col_rescale = scales::rescale(), col_steps = FALSE, col_transform = NULL, facet_axes = NULL, facet_axis_labels = "margins", facet_drop = FALSE, facet_labels = NULL, facet_layout = NULL, facet_ncol = NULL, facet_nrow = NULL, facet_scales = "fixed", facet_space = "fixed", title = NULL, subtitle = NULL, caption = NULL, label_case = NULL )
gg_function( data = NULL, ..., stat = "function", position = "identity", coord = ggplot2::coord_cartesian(clip = "off"), theme = NULL, theme_orientation = NULL, theme_axis_line_rm = NULL, theme_axis_ticks_rm = NULL, theme_panel_grid_rm = NULL, blend = NULL, x = NULL, xmin = NULL, xmax = NULL, xend = NULL, y = NULL, ymin = NULL, ymax = NULL, yend = NULL, z = NULL, col = NULL, facet = NULL, facet2 = NULL, group = NULL, subgroup = NULL, label = NULL, text = NULL, sample = NULL, mapping = NULL, x_breaks = NULL, x_breaks_n = NULL, x_expand = NULL, x_expand_limits = NULL, x_label = NULL, x_labels = NULL, x_position = "bottom", x_sec_axis = ggplot2::waiver(), x_symmetric = NULL, x_transform = NULL, y_breaks = NULL, y_breaks_n = NULL, y_expand = NULL, y_expand_limits = NULL, y_label = NULL, y_labels = NULL, y_position = "left", y_sec_axis = ggplot2::waiver(), y_symmetric = NULL, y_transform = NULL, col_breaks = NULL, col_breaks_n = 5, col_drop = FALSE, col_expand_limits = NULL, col_label = NULL, col_labels = NULL, col_legend_ncol = NULL, col_legend_nrow = NULL, col_legend_rev = FALSE, col_palette = NULL, col_palette_na = NULL, col_rescale = scales::rescale(), col_steps = FALSE, col_transform = NULL, facet_axes = NULL, facet_axis_labels = "margins", facet_drop = FALSE, facet_labels = NULL, facet_layout = NULL, facet_ncol = NULL, facet_nrow = NULL, facet_scales = "fixed", facet_space = "fixed", title = NULL, subtitle = NULL, caption = NULL, label_case = NULL )
data |
A data frame or tibble. |
... |
Other arguments passed to within a |
stat |
A statistical transformation to use on the data. A snakecase character string of a ggproto Stat subclass object minus the Stat prefix (e.g. |
position |
A position adjustment. A snakecase character string of a ggproto Position subclass object minus the Position prefix (e.g. |
coord |
A coordinate system. A |
theme |
A ggplot2 theme (e.g. |
theme_orientation |
The orientation of plot, which affects the theme components that are removed. Either |
theme_axis_line_rm |
|
theme_axis_ticks_rm |
|
theme_panel_grid_rm |
|
blend |
The blending mode per |
x , xmin , xmax , xend , y , ymin , ymax , yend , z , col , facet , facet2 , group , subgroup , label , text , sample
|
An unquoted aesthetic variable. |
mapping |
A set of additional aesthetic mappings in |
x_breaks , y_breaks , col_breaks
|
A |
x_breaks_n , y_breaks_n , col_breaks_n
|
A number of desired breaks for when |
x_expand , y_expand
|
Padding to the limits with the |
x_expand_limits , y_expand_limits , col_expand_limits
|
For a continuous variable, any values that the limits should encompass (e.g. |
x_label , y_label , col_label
|
Label for the axis or legend title. Use |
x_labels , y_labels , col_labels , facet_labels
|
A function that takes the breaks as inputs (e.g. |
x_position , y_position
|
The position of the axis (i.e. |
x_sec_axis , y_sec_axis
|
A secondary axis with |
x_symmetric , y_symmetric
|
|
x_transform , y_transform , col_transform
|
For a continuous scale, a transformation object (e.g. |
col_drop , facet_drop
|
For a discrete variable, FALSE or TRUE of whether to drop unused levels. |
col_legend_ncol , col_legend_nrow
|
The number of columns and rows in a legend guide. |
col_legend_rev |
|
col_palette |
A character vector of hex codes (or names) or a |
col_palette_na |
A hex code (or name) for the colour of |
col_rescale |
For a continuous variable, a |
col_steps |
For a continuous variable, |
facet_axes |
Whether to add interior axes and ticks with |
facet_axis_labels |
Whether to add interior axis labels with |
facet_layout |
Whether the layout is to be |
facet_ncol , facet_nrow
|
The number of columns and rows of facet panels. Only applies to a facet layout of |
facet_scales |
Whether facet scales should be |
facet_space |
When the facet scales are not |
title |
Title string. |
subtitle |
Subtitle string. |
caption |
Caption title string. |
label_case |
A function to format the label of unlabelled variables. Defaults to |
A ggplot object.
library(ggplot2) library(dplyr) set_blanket() gg_function( fun = \(x) dnorm(x, mean = 0, sd = 5), x_expand_limits = qnorm(p = c(0.005, 0.995), mean = 0, sd = 5), y_expand_limits = 0, )
library(ggplot2) library(dplyr) set_blanket() gg_function( fun = \(x) dnorm(x, mean = 0, sd = 5), x_expand_limits = qnorm(p = c(0.005, 0.995), mean = 0, sd = 5), y_expand_limits = 0, )
Create a hex ggplot with a wrapper around ggplot2::ggplot()
+ geom_hex().
gg_hex( data = NULL, ..., stat = "binhex", position = "identity", coord = ggplot2::coord_cartesian(clip = "off"), theme = NULL, theme_orientation = NULL, theme_axis_line_rm = NULL, theme_axis_ticks_rm = NULL, theme_panel_grid_rm = NULL, blend = NULL, x = NULL, xmin = NULL, xmax = NULL, xend = NULL, y = NULL, ymin = NULL, ymax = NULL, yend = NULL, z = NULL, col = NULL, facet = NULL, facet2 = NULL, group = NULL, subgroup = NULL, label = NULL, text = NULL, sample = NULL, mapping = NULL, x_breaks = NULL, x_breaks_n = NULL, x_expand = NULL, x_expand_limits = NULL, x_label = NULL, x_labels = NULL, x_position = "bottom", x_sec_axis = ggplot2::waiver(), x_symmetric = NULL, x_transform = NULL, y_breaks = NULL, y_breaks_n = NULL, y_expand = NULL, y_expand_limits = NULL, y_label = NULL, y_labels = NULL, y_position = "left", y_sec_axis = ggplot2::waiver(), y_symmetric = NULL, y_transform = NULL, col_breaks = NULL, col_breaks_n = 5, col_drop = FALSE, col_expand_limits = NULL, col_label = NULL, col_labels = NULL, col_legend_ncol = NULL, col_legend_nrow = NULL, col_legend_rev = FALSE, col_palette = NULL, col_palette_na = NULL, col_rescale = scales::rescale(), col_steps = FALSE, col_transform = NULL, facet_axes = NULL, facet_axis_labels = "margins", facet_drop = FALSE, facet_labels = NULL, facet_layout = NULL, facet_ncol = NULL, facet_nrow = NULL, facet_scales = "fixed", facet_space = "fixed", title = NULL, subtitle = NULL, caption = NULL, label_case = NULL )
gg_hex( data = NULL, ..., stat = "binhex", position = "identity", coord = ggplot2::coord_cartesian(clip = "off"), theme = NULL, theme_orientation = NULL, theme_axis_line_rm = NULL, theme_axis_ticks_rm = NULL, theme_panel_grid_rm = NULL, blend = NULL, x = NULL, xmin = NULL, xmax = NULL, xend = NULL, y = NULL, ymin = NULL, ymax = NULL, yend = NULL, z = NULL, col = NULL, facet = NULL, facet2 = NULL, group = NULL, subgroup = NULL, label = NULL, text = NULL, sample = NULL, mapping = NULL, x_breaks = NULL, x_breaks_n = NULL, x_expand = NULL, x_expand_limits = NULL, x_label = NULL, x_labels = NULL, x_position = "bottom", x_sec_axis = ggplot2::waiver(), x_symmetric = NULL, x_transform = NULL, y_breaks = NULL, y_breaks_n = NULL, y_expand = NULL, y_expand_limits = NULL, y_label = NULL, y_labels = NULL, y_position = "left", y_sec_axis = ggplot2::waiver(), y_symmetric = NULL, y_transform = NULL, col_breaks = NULL, col_breaks_n = 5, col_drop = FALSE, col_expand_limits = NULL, col_label = NULL, col_labels = NULL, col_legend_ncol = NULL, col_legend_nrow = NULL, col_legend_rev = FALSE, col_palette = NULL, col_palette_na = NULL, col_rescale = scales::rescale(), col_steps = FALSE, col_transform = NULL, facet_axes = NULL, facet_axis_labels = "margins", facet_drop = FALSE, facet_labels = NULL, facet_layout = NULL, facet_ncol = NULL, facet_nrow = NULL, facet_scales = "fixed", facet_space = "fixed", title = NULL, subtitle = NULL, caption = NULL, label_case = NULL )
data |
A data frame or tibble. |
... |
Other arguments passed to within a |
stat |
A statistical transformation to use on the data. A snakecase character string of a ggproto Stat subclass object minus the Stat prefix (e.g. |
position |
A position adjustment. A snakecase character string of a ggproto Position subclass object minus the Position prefix (e.g. |
coord |
A coordinate system. A |
theme |
A ggplot2 theme (e.g. |
theme_orientation |
The orientation of plot, which affects the theme components that are removed. Either |
theme_axis_line_rm |
|
theme_axis_ticks_rm |
|
theme_panel_grid_rm |
|
blend |
The blending mode per |
x , xmin , xmax , xend , y , ymin , ymax , yend , z , col , facet , facet2 , group , subgroup , label , text , sample
|
An unquoted aesthetic variable. |
mapping |
A set of additional aesthetic mappings in |
x_breaks , y_breaks , col_breaks
|
A |
x_breaks_n , y_breaks_n , col_breaks_n
|
A number of desired breaks for when |
x_expand , y_expand
|
Padding to the limits with the |
x_expand_limits , y_expand_limits , col_expand_limits
|
For a continuous variable, any values that the limits should encompass (e.g. |
x_label , y_label , col_label
|
Label for the axis or legend title. Use |
x_labels , y_labels , col_labels , facet_labels
|
A function that takes the breaks as inputs (e.g. |
x_position , y_position
|
The position of the axis (i.e. |
x_sec_axis , y_sec_axis
|
A secondary axis with |
x_symmetric , y_symmetric
|
|
x_transform , y_transform , col_transform
|
For a continuous scale, a transformation object (e.g. |
col_drop , facet_drop
|
For a discrete variable, FALSE or TRUE of whether to drop unused levels. |
col_legend_ncol , col_legend_nrow
|
The number of columns and rows in a legend guide. |
col_legend_rev |
|
col_palette |
A character vector of hex codes (or names) or a |
col_palette_na |
A hex code (or name) for the colour of |
col_rescale |
For a continuous variable, a |
col_steps |
For a continuous variable, |
facet_axes |
Whether to add interior axes and ticks with |
facet_axis_labels |
Whether to add interior axis labels with |
facet_layout |
Whether the layout is to be |
facet_ncol , facet_nrow
|
The number of columns and rows of facet panels. Only applies to a facet layout of |
facet_scales |
Whether facet scales should be |
facet_space |
When the facet scales are not |
title |
Title string. |
subtitle |
Subtitle string. |
caption |
Caption title string. |
label_case |
A function to format the label of unlabelled variables. Defaults to |
A ggplot object.
library(ggplot2) library(dplyr) library(palmerpenguins) set_blanket() diamonds |> gg_hex( x = carat, y = price, )
library(ggplot2) library(dplyr) library(palmerpenguins) set_blanket() diamonds |> gg_hex( x = carat, y = price, )
Create a histogram ggplot with a wrapper around ggplot2::ggplot()
+ geom_histogram().
gg_histogram( data = NULL, ..., stat = "bin", position = "stack", coord = ggplot2::coord_cartesian(clip = "off"), theme = NULL, theme_orientation = NULL, theme_axis_line_rm = NULL, theme_axis_ticks_rm = NULL, theme_panel_grid_rm = NULL, blend = NULL, x = NULL, xmin = NULL, xmax = NULL, xend = NULL, y = NULL, ymin = NULL, ymax = NULL, yend = NULL, z = NULL, col = NULL, facet = NULL, facet2 = NULL, group = NULL, subgroup = NULL, label = NULL, text = NULL, sample = NULL, mapping = NULL, x_breaks = NULL, x_breaks_n = NULL, x_expand = NULL, x_expand_limits = NULL, x_label = NULL, x_labels = NULL, x_position = "bottom", x_sec_axis = ggplot2::waiver(), x_symmetric = NULL, x_transform = NULL, y_breaks = NULL, y_breaks_n = NULL, y_expand = NULL, y_expand_limits = NULL, y_label = NULL, y_labels = NULL, y_position = "left", y_sec_axis = ggplot2::waiver(), y_symmetric = NULL, y_transform = NULL, col_breaks = NULL, col_breaks_n = 5, col_drop = FALSE, col_expand_limits = NULL, col_label = NULL, col_labels = NULL, col_legend_ncol = NULL, col_legend_nrow = NULL, col_legend_rev = FALSE, col_palette = NULL, col_palette_na = NULL, col_rescale = scales::rescale(), col_steps = FALSE, col_transform = NULL, facet_axes = NULL, facet_axis_labels = "margins", facet_drop = FALSE, facet_labels = NULL, facet_layout = NULL, facet_ncol = NULL, facet_nrow = NULL, facet_scales = "fixed", facet_space = "fixed", title = NULL, subtitle = NULL, caption = NULL, label_case = NULL )
gg_histogram( data = NULL, ..., stat = "bin", position = "stack", coord = ggplot2::coord_cartesian(clip = "off"), theme = NULL, theme_orientation = NULL, theme_axis_line_rm = NULL, theme_axis_ticks_rm = NULL, theme_panel_grid_rm = NULL, blend = NULL, x = NULL, xmin = NULL, xmax = NULL, xend = NULL, y = NULL, ymin = NULL, ymax = NULL, yend = NULL, z = NULL, col = NULL, facet = NULL, facet2 = NULL, group = NULL, subgroup = NULL, label = NULL, text = NULL, sample = NULL, mapping = NULL, x_breaks = NULL, x_breaks_n = NULL, x_expand = NULL, x_expand_limits = NULL, x_label = NULL, x_labels = NULL, x_position = "bottom", x_sec_axis = ggplot2::waiver(), x_symmetric = NULL, x_transform = NULL, y_breaks = NULL, y_breaks_n = NULL, y_expand = NULL, y_expand_limits = NULL, y_label = NULL, y_labels = NULL, y_position = "left", y_sec_axis = ggplot2::waiver(), y_symmetric = NULL, y_transform = NULL, col_breaks = NULL, col_breaks_n = 5, col_drop = FALSE, col_expand_limits = NULL, col_label = NULL, col_labels = NULL, col_legend_ncol = NULL, col_legend_nrow = NULL, col_legend_rev = FALSE, col_palette = NULL, col_palette_na = NULL, col_rescale = scales::rescale(), col_steps = FALSE, col_transform = NULL, facet_axes = NULL, facet_axis_labels = "margins", facet_drop = FALSE, facet_labels = NULL, facet_layout = NULL, facet_ncol = NULL, facet_nrow = NULL, facet_scales = "fixed", facet_space = "fixed", title = NULL, subtitle = NULL, caption = NULL, label_case = NULL )
data |
A data frame or tibble. |
... |
Other arguments passed to within a |
stat |
A statistical transformation to use on the data. A snakecase character string of a ggproto Stat subclass object minus the Stat prefix (e.g. |
position |
A position adjustment. A snakecase character string of a ggproto Position subclass object minus the Position prefix (e.g. |
coord |
A coordinate system. A |
theme |
A ggplot2 theme (e.g. |
theme_orientation |
The orientation of plot, which affects the theme components that are removed. Either |
theme_axis_line_rm |
|
theme_axis_ticks_rm |
|
theme_panel_grid_rm |
|
blend |
The blending mode per |
x , xmin , xmax , xend , y , ymin , ymax , yend , z , col , facet , facet2 , group , subgroup , label , text , sample
|
An unquoted aesthetic variable. |
mapping |
A set of additional aesthetic mappings in |
x_breaks , y_breaks , col_breaks
|
A |
x_breaks_n , y_breaks_n , col_breaks_n
|
A number of desired breaks for when |
x_expand , y_expand
|
Padding to the limits with the |
x_expand_limits , y_expand_limits , col_expand_limits
|
For a continuous variable, any values that the limits should encompass (e.g. |
x_label , y_label , col_label
|
Label for the axis or legend title. Use |
x_labels , y_labels , col_labels , facet_labels
|
A function that takes the breaks as inputs (e.g. |
x_position , y_position
|
The position of the axis (i.e. |
x_sec_axis , y_sec_axis
|
A secondary axis with |
x_symmetric , y_symmetric
|
|
x_transform , y_transform , col_transform
|
For a continuous scale, a transformation object (e.g. |
col_drop , facet_drop
|
For a discrete variable, FALSE or TRUE of whether to drop unused levels. |
col_legend_ncol , col_legend_nrow
|
The number of columns and rows in a legend guide. |
col_legend_rev |
|
col_palette |
A character vector of hex codes (or names) or a |
col_palette_na |
A hex code (or name) for the colour of |
col_rescale |
For a continuous variable, a |
col_steps |
For a continuous variable, |
facet_axes |
Whether to add interior axes and ticks with |
facet_axis_labels |
Whether to add interior axis labels with |
facet_layout |
Whether the layout is to be |
facet_ncol , facet_nrow
|
The number of columns and rows of facet panels. Only applies to a facet layout of |
facet_scales |
Whether facet scales should be |
facet_space |
When the facet scales are not |
title |
Title string. |
subtitle |
Subtitle string. |
caption |
Caption title string. |
label_case |
A function to format the label of unlabelled variables. Defaults to |
A ggplot object.
library(ggplot2) library(dplyr) library(palmerpenguins) set_blanket() penguins |> gg_histogram( x = flipper_length_mm, col = sex, bins = 50, )
library(ggplot2) library(dplyr) library(palmerpenguins) set_blanket() penguins |> gg_histogram( x = flipper_length_mm, col = sex, bins = 50, )
Create a jitter ggplot with a wrapper around ggplot2::ggplot()
+ geom_jitter().
gg_jitter( data = NULL, ..., stat = "identity", position = "jitter", coord = ggplot2::coord_cartesian(clip = "off"), theme = NULL, theme_orientation = NULL, theme_axis_line_rm = NULL, theme_axis_ticks_rm = NULL, theme_panel_grid_rm = NULL, blend = NULL, x = NULL, xmin = NULL, xmax = NULL, xend = NULL, y = NULL, ymin = NULL, ymax = NULL, yend = NULL, z = NULL, col = NULL, facet = NULL, facet2 = NULL, group = NULL, subgroup = NULL, label = NULL, text = NULL, sample = NULL, mapping = NULL, x_breaks = NULL, x_breaks_n = NULL, x_expand = NULL, x_expand_limits = NULL, x_label = NULL, x_labels = NULL, x_position = "bottom", x_sec_axis = ggplot2::waiver(), x_symmetric = NULL, x_transform = NULL, y_breaks = NULL, y_breaks_n = NULL, y_expand = NULL, y_expand_limits = NULL, y_label = NULL, y_labels = NULL, y_position = "left", y_sec_axis = ggplot2::waiver(), y_symmetric = NULL, y_transform = NULL, col_breaks = NULL, col_breaks_n = 5, col_drop = FALSE, col_expand_limits = NULL, col_label = NULL, col_labels = NULL, col_legend_ncol = NULL, col_legend_nrow = NULL, col_legend_rev = FALSE, col_palette = NULL, col_palette_na = NULL, col_rescale = scales::rescale(), col_steps = FALSE, col_transform = NULL, facet_axes = NULL, facet_axis_labels = "margins", facet_drop = FALSE, facet_labels = NULL, facet_layout = NULL, facet_ncol = NULL, facet_nrow = NULL, facet_scales = "fixed", facet_space = "fixed", title = NULL, subtitle = NULL, caption = NULL, label_case = NULL )
gg_jitter( data = NULL, ..., stat = "identity", position = "jitter", coord = ggplot2::coord_cartesian(clip = "off"), theme = NULL, theme_orientation = NULL, theme_axis_line_rm = NULL, theme_axis_ticks_rm = NULL, theme_panel_grid_rm = NULL, blend = NULL, x = NULL, xmin = NULL, xmax = NULL, xend = NULL, y = NULL, ymin = NULL, ymax = NULL, yend = NULL, z = NULL, col = NULL, facet = NULL, facet2 = NULL, group = NULL, subgroup = NULL, label = NULL, text = NULL, sample = NULL, mapping = NULL, x_breaks = NULL, x_breaks_n = NULL, x_expand = NULL, x_expand_limits = NULL, x_label = NULL, x_labels = NULL, x_position = "bottom", x_sec_axis = ggplot2::waiver(), x_symmetric = NULL, x_transform = NULL, y_breaks = NULL, y_breaks_n = NULL, y_expand = NULL, y_expand_limits = NULL, y_label = NULL, y_labels = NULL, y_position = "left", y_sec_axis = ggplot2::waiver(), y_symmetric = NULL, y_transform = NULL, col_breaks = NULL, col_breaks_n = 5, col_drop = FALSE, col_expand_limits = NULL, col_label = NULL, col_labels = NULL, col_legend_ncol = NULL, col_legend_nrow = NULL, col_legend_rev = FALSE, col_palette = NULL, col_palette_na = NULL, col_rescale = scales::rescale(), col_steps = FALSE, col_transform = NULL, facet_axes = NULL, facet_axis_labels = "margins", facet_drop = FALSE, facet_labels = NULL, facet_layout = NULL, facet_ncol = NULL, facet_nrow = NULL, facet_scales = "fixed", facet_space = "fixed", title = NULL, subtitle = NULL, caption = NULL, label_case = NULL )
data |
A data frame or tibble. |
... |
Other arguments passed to within a |
stat |
A statistical transformation to use on the data. A snakecase character string of a ggproto Stat subclass object minus the Stat prefix (e.g. |
position |
A position adjustment. A snakecase character string of a ggproto Position subclass object minus the Position prefix (e.g. |
coord |
A coordinate system. A |
theme |
A ggplot2 theme (e.g. |
theme_orientation |
The orientation of plot, which affects the theme components that are removed. Either |
theme_axis_line_rm |
|
theme_axis_ticks_rm |
|
theme_panel_grid_rm |
|
blend |
The blending mode per |
x , xmin , xmax , xend , y , ymin , ymax , yend , z , col , facet , facet2 , group , subgroup , label , text , sample
|
An unquoted aesthetic variable. |
mapping |
A set of additional aesthetic mappings in |
x_breaks , y_breaks , col_breaks
|
A |
x_breaks_n , y_breaks_n , col_breaks_n
|
A number of desired breaks for when |
x_expand , y_expand
|
Padding to the limits with the |
x_expand_limits , y_expand_limits , col_expand_limits
|
For a continuous variable, any values that the limits should encompass (e.g. |
x_label , y_label , col_label
|
Label for the axis or legend title. Use |
x_labels , y_labels , col_labels , facet_labels
|
A function that takes the breaks as inputs (e.g. |
x_position , y_position
|
The position of the axis (i.e. |
x_sec_axis , y_sec_axis
|
A secondary axis with |
x_symmetric , y_symmetric
|
|
x_transform , y_transform , col_transform
|
For a continuous scale, a transformation object (e.g. |
col_drop , facet_drop
|
For a discrete variable, FALSE or TRUE of whether to drop unused levels. |
col_legend_ncol , col_legend_nrow
|
The number of columns and rows in a legend guide. |
col_legend_rev |
|
col_palette |
A character vector of hex codes (or names) or a |
col_palette_na |
A hex code (or name) for the colour of |
col_rescale |
For a continuous variable, a |
col_steps |
For a continuous variable, |
facet_axes |
Whether to add interior axes and ticks with |
facet_axis_labels |
Whether to add interior axis labels with |
facet_layout |
Whether the layout is to be |
facet_ncol , facet_nrow
|
The number of columns and rows of facet panels. Only applies to a facet layout of |
facet_scales |
Whether facet scales should be |
facet_space |
When the facet scales are not |
title |
Title string. |
subtitle |
Subtitle string. |
caption |
Caption title string. |
label_case |
A function to format the label of unlabelled variables. Defaults to |
A ggplot object.
library(ggplot2) library(dplyr) library(palmerpenguins) set_blanket() set.seed(123) penguins |> gg_jitter( x = species, y = body_mass_g, col = flipper_length_mm, position = position_jitter(height = 0), y_expand_limits = 0, col_steps = TRUE, )
library(ggplot2) library(dplyr) library(palmerpenguins) set_blanket() set.seed(123) penguins |> gg_jitter( x = species, y = body_mass_g, col = flipper_length_mm, position = position_jitter(height = 0), y_expand_limits = 0, col_steps = TRUE, )
Create a label ggplot with a wrapper around ggplot2::ggplot()
+ geom_label().
gg_label( data = NULL, ..., stat = "identity", position = "identity", coord = ggplot2::coord_cartesian(clip = "off"), theme = NULL, theme_orientation = NULL, theme_axis_line_rm = NULL, theme_axis_ticks_rm = NULL, theme_panel_grid_rm = NULL, blend = NULL, x = NULL, xmin = NULL, xmax = NULL, xend = NULL, y = NULL, ymin = NULL, ymax = NULL, yend = NULL, z = NULL, col = NULL, facet = NULL, facet2 = NULL, group = NULL, subgroup = NULL, label = NULL, text = NULL, sample = NULL, mapping = NULL, x_breaks = NULL, x_breaks_n = NULL, x_expand = NULL, x_expand_limits = NULL, x_label = NULL, x_labels = NULL, x_position = "bottom", x_sec_axis = ggplot2::waiver(), x_symmetric = NULL, x_transform = NULL, y_breaks = NULL, y_breaks_n = NULL, y_expand = NULL, y_expand_limits = NULL, y_label = NULL, y_labels = NULL, y_position = "left", y_sec_axis = ggplot2::waiver(), y_symmetric = NULL, y_transform = NULL, col_breaks = NULL, col_breaks_n = 5, col_drop = FALSE, col_expand_limits = NULL, col_label = NULL, col_labels = NULL, col_legend_ncol = NULL, col_legend_nrow = NULL, col_legend_rev = FALSE, col_palette = NULL, col_palette_na = NULL, col_rescale = scales::rescale(), col_steps = FALSE, col_transform = NULL, facet_axes = NULL, facet_axis_labels = "margins", facet_drop = FALSE, facet_labels = NULL, facet_layout = NULL, facet_ncol = NULL, facet_nrow = NULL, facet_scales = "fixed", facet_space = "fixed", title = NULL, subtitle = NULL, caption = NULL, label_case = NULL )
gg_label( data = NULL, ..., stat = "identity", position = "identity", coord = ggplot2::coord_cartesian(clip = "off"), theme = NULL, theme_orientation = NULL, theme_axis_line_rm = NULL, theme_axis_ticks_rm = NULL, theme_panel_grid_rm = NULL, blend = NULL, x = NULL, xmin = NULL, xmax = NULL, xend = NULL, y = NULL, ymin = NULL, ymax = NULL, yend = NULL, z = NULL, col = NULL, facet = NULL, facet2 = NULL, group = NULL, subgroup = NULL, label = NULL, text = NULL, sample = NULL, mapping = NULL, x_breaks = NULL, x_breaks_n = NULL, x_expand = NULL, x_expand_limits = NULL, x_label = NULL, x_labels = NULL, x_position = "bottom", x_sec_axis = ggplot2::waiver(), x_symmetric = NULL, x_transform = NULL, y_breaks = NULL, y_breaks_n = NULL, y_expand = NULL, y_expand_limits = NULL, y_label = NULL, y_labels = NULL, y_position = "left", y_sec_axis = ggplot2::waiver(), y_symmetric = NULL, y_transform = NULL, col_breaks = NULL, col_breaks_n = 5, col_drop = FALSE, col_expand_limits = NULL, col_label = NULL, col_labels = NULL, col_legend_ncol = NULL, col_legend_nrow = NULL, col_legend_rev = FALSE, col_palette = NULL, col_palette_na = NULL, col_rescale = scales::rescale(), col_steps = FALSE, col_transform = NULL, facet_axes = NULL, facet_axis_labels = "margins", facet_drop = FALSE, facet_labels = NULL, facet_layout = NULL, facet_ncol = NULL, facet_nrow = NULL, facet_scales = "fixed", facet_space = "fixed", title = NULL, subtitle = NULL, caption = NULL, label_case = NULL )
data |
A data frame or tibble. |
... |
Other arguments passed to within a |
stat |
A statistical transformation to use on the data. A snakecase character string of a ggproto Stat subclass object minus the Stat prefix (e.g. |
position |
A position adjustment. A snakecase character string of a ggproto Position subclass object minus the Position prefix (e.g. |
coord |
A coordinate system. A |
theme |
A ggplot2 theme (e.g. |
theme_orientation |
The orientation of plot, which affects the theme components that are removed. Either |
theme_axis_line_rm |
|
theme_axis_ticks_rm |
|
theme_panel_grid_rm |
|
blend |
The blending mode per |
x , xmin , xmax , xend , y , ymin , ymax , yend , z , col , facet , facet2 , group , subgroup , label , text , sample
|
An unquoted aesthetic variable. |
mapping |
A set of additional aesthetic mappings in |
x_breaks , y_breaks , col_breaks
|
A |
x_breaks_n , y_breaks_n , col_breaks_n
|
A number of desired breaks for when |
x_expand , y_expand
|
Padding to the limits with the |
x_expand_limits , y_expand_limits , col_expand_limits
|
For a continuous variable, any values that the limits should encompass (e.g. |
x_label , y_label , col_label
|
Label for the axis or legend title. Use |
x_labels , y_labels , col_labels , facet_labels
|
A function that takes the breaks as inputs (e.g. |
x_position , y_position
|
The position of the axis (i.e. |
x_sec_axis , y_sec_axis
|
A secondary axis with |
x_symmetric , y_symmetric
|
|
x_transform , y_transform , col_transform
|
For a continuous scale, a transformation object (e.g. |
col_drop , facet_drop
|
For a discrete variable, FALSE or TRUE of whether to drop unused levels. |
col_legend_ncol , col_legend_nrow
|
The number of columns and rows in a legend guide. |
col_legend_rev |
|
col_palette |
A character vector of hex codes (or names) or a |
col_palette_na |
A hex code (or name) for the colour of |
col_rescale |
For a continuous variable, a |
col_steps |
For a continuous variable, |
facet_axes |
Whether to add interior axes and ticks with |
facet_axis_labels |
Whether to add interior axis labels with |
facet_layout |
Whether the layout is to be |
facet_ncol , facet_nrow
|
The number of columns and rows of facet panels. Only applies to a facet layout of |
facet_scales |
Whether facet scales should be |
facet_space |
When the facet scales are not |
title |
Title string. |
subtitle |
Subtitle string. |
caption |
Caption title string. |
label_case |
A function to format the label of unlabelled variables. Defaults to |
A ggplot object.
library(ggplot2) library(dplyr) set_blanket() set_font_defaults() bind_rows( mtcars |> slice_min(order_by = mpg), mtcars |> slice_max(order_by = mpg) ) |> tibble::rownames_to_column("themel") |> gg_label( x = themel, y = mpg, label = themel, y_expand_limits = 0, y_label = "Miles per gallon", col_palette = c(orange, "white", teal), )
library(ggplot2) library(dplyr) set_blanket() set_font_defaults() bind_rows( mtcars |> slice_min(order_by = mpg), mtcars |> slice_max(order_by = mpg) ) |> tibble::rownames_to_column("themel") |> gg_label( x = themel, y = mpg, label = themel, y_expand_limits = 0, y_label = "Miles per gallon", col_palette = c(orange, "white", teal), )
Create a line ggplot with a wrapper around ggplot2::ggplot()
+ geom_line().
gg_line( data = NULL, ..., stat = "identity", position = "identity", coord = ggplot2::coord_cartesian(clip = "off"), theme = NULL, theme_orientation = NULL, theme_axis_line_rm = NULL, theme_axis_ticks_rm = NULL, theme_panel_grid_rm = NULL, blend = NULL, x = NULL, xmin = NULL, xmax = NULL, xend = NULL, y = NULL, ymin = NULL, ymax = NULL, yend = NULL, z = NULL, col = NULL, facet = NULL, facet2 = NULL, group = NULL, subgroup = NULL, label = NULL, text = NULL, sample = NULL, mapping = NULL, x_breaks = NULL, x_breaks_n = NULL, x_expand = NULL, x_expand_limits = NULL, x_label = NULL, x_labels = NULL, x_position = "bottom", x_sec_axis = ggplot2::waiver(), x_symmetric = NULL, x_transform = NULL, y_breaks = NULL, y_breaks_n = NULL, y_expand = NULL, y_expand_limits = NULL, y_label = NULL, y_labels = NULL, y_position = "left", y_sec_axis = ggplot2::waiver(), y_symmetric = NULL, y_transform = NULL, col_breaks = NULL, col_breaks_n = 5, col_drop = FALSE, col_expand_limits = NULL, col_label = NULL, col_labels = NULL, col_legend_ncol = NULL, col_legend_nrow = NULL, col_legend_rev = FALSE, col_palette = NULL, col_palette_na = NULL, col_rescale = scales::rescale(), col_steps = FALSE, col_transform = NULL, facet_axes = NULL, facet_axis_labels = "margins", facet_drop = FALSE, facet_labels = NULL, facet_layout = NULL, facet_ncol = NULL, facet_nrow = NULL, facet_scales = "fixed", facet_space = "fixed", title = NULL, subtitle = NULL, caption = NULL, label_case = NULL )
gg_line( data = NULL, ..., stat = "identity", position = "identity", coord = ggplot2::coord_cartesian(clip = "off"), theme = NULL, theme_orientation = NULL, theme_axis_line_rm = NULL, theme_axis_ticks_rm = NULL, theme_panel_grid_rm = NULL, blend = NULL, x = NULL, xmin = NULL, xmax = NULL, xend = NULL, y = NULL, ymin = NULL, ymax = NULL, yend = NULL, z = NULL, col = NULL, facet = NULL, facet2 = NULL, group = NULL, subgroup = NULL, label = NULL, text = NULL, sample = NULL, mapping = NULL, x_breaks = NULL, x_breaks_n = NULL, x_expand = NULL, x_expand_limits = NULL, x_label = NULL, x_labels = NULL, x_position = "bottom", x_sec_axis = ggplot2::waiver(), x_symmetric = NULL, x_transform = NULL, y_breaks = NULL, y_breaks_n = NULL, y_expand = NULL, y_expand_limits = NULL, y_label = NULL, y_labels = NULL, y_position = "left", y_sec_axis = ggplot2::waiver(), y_symmetric = NULL, y_transform = NULL, col_breaks = NULL, col_breaks_n = 5, col_drop = FALSE, col_expand_limits = NULL, col_label = NULL, col_labels = NULL, col_legend_ncol = NULL, col_legend_nrow = NULL, col_legend_rev = FALSE, col_palette = NULL, col_palette_na = NULL, col_rescale = scales::rescale(), col_steps = FALSE, col_transform = NULL, facet_axes = NULL, facet_axis_labels = "margins", facet_drop = FALSE, facet_labels = NULL, facet_layout = NULL, facet_ncol = NULL, facet_nrow = NULL, facet_scales = "fixed", facet_space = "fixed", title = NULL, subtitle = NULL, caption = NULL, label_case = NULL )
data |
A data frame or tibble. |
... |
Other arguments passed to within a |
stat |
A statistical transformation to use on the data. A snakecase character string of a ggproto Stat subclass object minus the Stat prefix (e.g. |
position |
A position adjustment. A snakecase character string of a ggproto Position subclass object minus the Position prefix (e.g. |
coord |
A coordinate system. A |
theme |
A ggplot2 theme (e.g. |
theme_orientation |
The orientation of plot, which affects the theme components that are removed. Either |
theme_axis_line_rm |
|
theme_axis_ticks_rm |
|
theme_panel_grid_rm |
|
blend |
The blending mode per |
x , xmin , xmax , xend , y , ymin , ymax , yend , z , col , facet , facet2 , group , subgroup , label , text , sample
|
An unquoted aesthetic variable. |
mapping |
A set of additional aesthetic mappings in |
x_breaks , y_breaks , col_breaks
|
A |
x_breaks_n , y_breaks_n , col_breaks_n
|
A number of desired breaks for when |
x_expand , y_expand
|
Padding to the limits with the |
x_expand_limits , y_expand_limits , col_expand_limits
|
For a continuous variable, any values that the limits should encompass (e.g. |
x_label , y_label , col_label
|
Label for the axis or legend title. Use |
x_labels , y_labels , col_labels , facet_labels
|
A function that takes the breaks as inputs (e.g. |
x_position , y_position
|
The position of the axis (i.e. |
x_sec_axis , y_sec_axis
|
A secondary axis with |
x_symmetric , y_symmetric
|
|
x_transform , y_transform , col_transform
|
For a continuous scale, a transformation object (e.g. |
col_drop , facet_drop
|
For a discrete variable, FALSE or TRUE of whether to drop unused levels. |
col_legend_ncol , col_legend_nrow
|
The number of columns and rows in a legend guide. |
col_legend_rev |
|
col_palette |
A character vector of hex codes (or names) or a |
col_palette_na |
A hex code (or name) for the colour of |
col_rescale |
For a continuous variable, a |
col_steps |
For a continuous variable, |
facet_axes |
Whether to add interior axes and ticks with |
facet_axis_labels |
Whether to add interior axis labels with |
facet_layout |
Whether the layout is to be |
facet_ncol , facet_nrow
|
The number of columns and rows of facet panels. Only applies to a facet layout of |
facet_scales |
Whether facet scales should be |
facet_space |
When the facet scales are not |
title |
Title string. |
subtitle |
Subtitle string. |
caption |
Caption title string. |
label_case |
A function to format the label of unlabelled variables. Defaults to |
A ggplot object.
library(ggplot2) library(dplyr) set_blanket() economics |> gg_line( x = date, y = unemploy, y_expand_limits = 0, y_label = "Unemployment", )
library(ggplot2) library(dplyr) set_blanket() economics |> gg_line( x = date, y = unemploy, y_expand_limits = 0, y_label = "Unemployment", )
Create a linerange ggplot with a wrapper around ggplot2::ggplot()
+ geom_linerange().
gg_linerange( data = NULL, ..., stat = "identity", position = "identity", coord = ggplot2::coord_cartesian(clip = "off"), theme = NULL, theme_orientation = NULL, theme_axis_line_rm = NULL, theme_axis_ticks_rm = NULL, theme_panel_grid_rm = NULL, blend = NULL, x = NULL, xmin = NULL, xmax = NULL, xend = NULL, y = NULL, ymin = NULL, ymax = NULL, yend = NULL, z = NULL, col = NULL, facet = NULL, facet2 = NULL, group = NULL, subgroup = NULL, label = NULL, text = NULL, sample = NULL, mapping = NULL, x_breaks = NULL, x_breaks_n = NULL, x_expand = NULL, x_expand_limits = NULL, x_label = NULL, x_labels = NULL, x_position = "bottom", x_sec_axis = ggplot2::waiver(), x_symmetric = NULL, x_transform = NULL, y_breaks = NULL, y_breaks_n = NULL, y_expand = NULL, y_expand_limits = NULL, y_label = NULL, y_labels = NULL, y_position = "left", y_sec_axis = ggplot2::waiver(), y_symmetric = NULL, y_transform = NULL, col_breaks = NULL, col_breaks_n = 5, col_drop = FALSE, col_expand_limits = NULL, col_label = NULL, col_labels = NULL, col_legend_ncol = NULL, col_legend_nrow = NULL, col_legend_rev = FALSE, col_palette = NULL, col_palette_na = NULL, col_rescale = scales::rescale(), col_steps = FALSE, col_transform = NULL, facet_axes = NULL, facet_axis_labels = "margins", facet_drop = FALSE, facet_labels = NULL, facet_layout = NULL, facet_ncol = NULL, facet_nrow = NULL, facet_scales = "fixed", facet_space = "fixed", title = NULL, subtitle = NULL, caption = NULL, label_case = NULL )
gg_linerange( data = NULL, ..., stat = "identity", position = "identity", coord = ggplot2::coord_cartesian(clip = "off"), theme = NULL, theme_orientation = NULL, theme_axis_line_rm = NULL, theme_axis_ticks_rm = NULL, theme_panel_grid_rm = NULL, blend = NULL, x = NULL, xmin = NULL, xmax = NULL, xend = NULL, y = NULL, ymin = NULL, ymax = NULL, yend = NULL, z = NULL, col = NULL, facet = NULL, facet2 = NULL, group = NULL, subgroup = NULL, label = NULL, text = NULL, sample = NULL, mapping = NULL, x_breaks = NULL, x_breaks_n = NULL, x_expand = NULL, x_expand_limits = NULL, x_label = NULL, x_labels = NULL, x_position = "bottom", x_sec_axis = ggplot2::waiver(), x_symmetric = NULL, x_transform = NULL, y_breaks = NULL, y_breaks_n = NULL, y_expand = NULL, y_expand_limits = NULL, y_label = NULL, y_labels = NULL, y_position = "left", y_sec_axis = ggplot2::waiver(), y_symmetric = NULL, y_transform = NULL, col_breaks = NULL, col_breaks_n = 5, col_drop = FALSE, col_expand_limits = NULL, col_label = NULL, col_labels = NULL, col_legend_ncol = NULL, col_legend_nrow = NULL, col_legend_rev = FALSE, col_palette = NULL, col_palette_na = NULL, col_rescale = scales::rescale(), col_steps = FALSE, col_transform = NULL, facet_axes = NULL, facet_axis_labels = "margins", facet_drop = FALSE, facet_labels = NULL, facet_layout = NULL, facet_ncol = NULL, facet_nrow = NULL, facet_scales = "fixed", facet_space = "fixed", title = NULL, subtitle = NULL, caption = NULL, label_case = NULL )
data |
A data frame or tibble. |
... |
Other arguments passed to within a |
stat |
A statistical transformation to use on the data. A snakecase character string of a ggproto Stat subclass object minus the Stat prefix (e.g. |
position |
A position adjustment. A snakecase character string of a ggproto Position subclass object minus the Position prefix (e.g. |
coord |
A coordinate system. A |
theme |
A ggplot2 theme (e.g. |
theme_orientation |
The orientation of plot, which affects the theme components that are removed. Either |
theme_axis_line_rm |
|
theme_axis_ticks_rm |
|
theme_panel_grid_rm |
|
blend |
The blending mode per |
x , xmin , xmax , xend , y , ymin , ymax , yend , z , col , facet , facet2 , group , subgroup , label , text , sample
|
An unquoted aesthetic variable. |
mapping |
A set of additional aesthetic mappings in |
x_breaks , y_breaks , col_breaks
|
A |
x_breaks_n , y_breaks_n , col_breaks_n
|
A number of desired breaks for when |
x_expand , y_expand
|
Padding to the limits with the |
x_expand_limits , y_expand_limits , col_expand_limits
|
For a continuous variable, any values that the limits should encompass (e.g. |
x_label , y_label , col_label
|
Label for the axis or legend title. Use |
x_labels , y_labels , col_labels , facet_labels
|
A function that takes the breaks as inputs (e.g. |
x_position , y_position
|
The position of the axis (i.e. |
x_sec_axis , y_sec_axis
|
A secondary axis with |
x_symmetric , y_symmetric
|
|
x_transform , y_transform , col_transform
|
For a continuous scale, a transformation object (e.g. |
col_drop , facet_drop
|
For a discrete variable, FALSE or TRUE of whether to drop unused levels. |
col_legend_ncol , col_legend_nrow
|
The number of columns and rows in a legend guide. |
col_legend_rev |
|
col_palette |
A character vector of hex codes (or names) or a |
col_palette_na |
A hex code (or name) for the colour of |
col_rescale |
For a continuous variable, a |
col_steps |
For a continuous variable, |
facet_axes |
Whether to add interior axes and ticks with |
facet_axis_labels |
Whether to add interior axis labels with |
facet_layout |
Whether the layout is to be |
facet_ncol , facet_nrow
|
The number of columns and rows of facet panels. Only applies to a facet layout of |
facet_scales |
Whether facet scales should be |
facet_space |
When the facet scales are not |
title |
Title string. |
subtitle |
Subtitle string. |
caption |
Caption title string. |
label_case |
A function to format the label of unlabelled variables. Defaults to |
A ggplot object.
library(ggplot2) library(dplyr) set_blanket() data.frame( trt = factor(c(1, 1, 2, 2)), resp = c(1, 5, 3, 4), group = factor(c(1, 2, 1, 2)), upper = c(1.1, 5.3, 3.3, 4.2), lower = c(0.8, 4.6, 2.4, 3.6) ) |> gg_linerange( x = trt, ymin = lower, ymax = upper, col = group, position = position_dodge(width = 0.2), x_label = "Treatment", y_label = "Response", )
library(ggplot2) library(dplyr) set_blanket() data.frame( trt = factor(c(1, 1, 2, 2)), resp = c(1, 5, 3, 4), group = factor(c(1, 2, 1, 2)), upper = c(1.1, 5.3, 3.3, 4.2), lower = c(0.8, 4.6, 2.4, 3.6) ) |> gg_linerange( x = trt, ymin = lower, ymax = upper, col = group, position = position_dodge(width = 0.2), x_label = "Treatment", y_label = "Response", )
Create a path ggplot with a wrapper around ggplot2::ggplot()
+ geom_path().
gg_path( data = NULL, ..., stat = "identity", position = "identity", coord = ggplot2::coord_cartesian(clip = "off"), theme = NULL, theme_orientation = NULL, theme_axis_line_rm = NULL, theme_axis_ticks_rm = NULL, theme_panel_grid_rm = NULL, blend = NULL, x = NULL, xmin = NULL, xmax = NULL, xend = NULL, y = NULL, ymin = NULL, ymax = NULL, yend = NULL, z = NULL, col = NULL, facet = NULL, facet2 = NULL, group = NULL, subgroup = NULL, label = NULL, text = NULL, sample = NULL, mapping = NULL, x_breaks = NULL, x_breaks_n = NULL, x_expand = NULL, x_expand_limits = NULL, x_label = NULL, x_labels = NULL, x_position = "bottom", x_sec_axis = ggplot2::waiver(), x_symmetric = NULL, x_transform = NULL, y_breaks = NULL, y_breaks_n = NULL, y_expand = NULL, y_expand_limits = NULL, y_label = NULL, y_labels = NULL, y_position = "left", y_sec_axis = ggplot2::waiver(), y_symmetric = NULL, y_transform = NULL, col_breaks = NULL, col_breaks_n = 5, col_drop = FALSE, col_expand_limits = NULL, col_label = NULL, col_labels = NULL, col_legend_ncol = NULL, col_legend_nrow = NULL, col_legend_rev = FALSE, col_palette = NULL, col_palette_na = NULL, col_rescale = scales::rescale(), col_steps = FALSE, col_transform = NULL, facet_axes = NULL, facet_axis_labels = "margins", facet_drop = FALSE, facet_labels = NULL, facet_layout = NULL, facet_ncol = NULL, facet_nrow = NULL, facet_scales = "fixed", facet_space = "fixed", title = NULL, subtitle = NULL, caption = NULL, label_case = NULL )
gg_path( data = NULL, ..., stat = "identity", position = "identity", coord = ggplot2::coord_cartesian(clip = "off"), theme = NULL, theme_orientation = NULL, theme_axis_line_rm = NULL, theme_axis_ticks_rm = NULL, theme_panel_grid_rm = NULL, blend = NULL, x = NULL, xmin = NULL, xmax = NULL, xend = NULL, y = NULL, ymin = NULL, ymax = NULL, yend = NULL, z = NULL, col = NULL, facet = NULL, facet2 = NULL, group = NULL, subgroup = NULL, label = NULL, text = NULL, sample = NULL, mapping = NULL, x_breaks = NULL, x_breaks_n = NULL, x_expand = NULL, x_expand_limits = NULL, x_label = NULL, x_labels = NULL, x_position = "bottom", x_sec_axis = ggplot2::waiver(), x_symmetric = NULL, x_transform = NULL, y_breaks = NULL, y_breaks_n = NULL, y_expand = NULL, y_expand_limits = NULL, y_label = NULL, y_labels = NULL, y_position = "left", y_sec_axis = ggplot2::waiver(), y_symmetric = NULL, y_transform = NULL, col_breaks = NULL, col_breaks_n = 5, col_drop = FALSE, col_expand_limits = NULL, col_label = NULL, col_labels = NULL, col_legend_ncol = NULL, col_legend_nrow = NULL, col_legend_rev = FALSE, col_palette = NULL, col_palette_na = NULL, col_rescale = scales::rescale(), col_steps = FALSE, col_transform = NULL, facet_axes = NULL, facet_axis_labels = "margins", facet_drop = FALSE, facet_labels = NULL, facet_layout = NULL, facet_ncol = NULL, facet_nrow = NULL, facet_scales = "fixed", facet_space = "fixed", title = NULL, subtitle = NULL, caption = NULL, label_case = NULL )
data |
A data frame or tibble. |
... |
Other arguments passed to within a |
stat |
A statistical transformation to use on the data. A snakecase character string of a ggproto Stat subclass object minus the Stat prefix (e.g. |
position |
A position adjustment. A snakecase character string of a ggproto Position subclass object minus the Position prefix (e.g. |
coord |
A coordinate system. A |
theme |
A ggplot2 theme (e.g. |
theme_orientation |
The orientation of plot, which affects the theme components that are removed. Either |
theme_axis_line_rm |
|
theme_axis_ticks_rm |
|
theme_panel_grid_rm |
|
blend |
The blending mode per |
x , xmin , xmax , xend , y , ymin , ymax , yend , z , col , facet , facet2 , group , subgroup , label , text , sample
|
An unquoted aesthetic variable. |
mapping |
A set of additional aesthetic mappings in |
x_breaks , y_breaks , col_breaks
|
A |
x_breaks_n , y_breaks_n , col_breaks_n
|
A number of desired breaks for when |
x_expand , y_expand
|
Padding to the limits with the |
x_expand_limits , y_expand_limits , col_expand_limits
|
For a continuous variable, any values that the limits should encompass (e.g. |
x_label , y_label , col_label
|
Label for the axis or legend title. Use |
x_labels , y_labels , col_labels , facet_labels
|
A function that takes the breaks as inputs (e.g. |
x_position , y_position
|
The position of the axis (i.e. |
x_sec_axis , y_sec_axis
|
A secondary axis with |
x_symmetric , y_symmetric
|
|
x_transform , y_transform , col_transform
|
For a continuous scale, a transformation object (e.g. |
col_drop , facet_drop
|
For a discrete variable, FALSE or TRUE of whether to drop unused levels. |
col_legend_ncol , col_legend_nrow
|
The number of columns and rows in a legend guide. |
col_legend_rev |
|
col_palette |
A character vector of hex codes (or names) or a |
col_palette_na |
A hex code (or name) for the colour of |
col_rescale |
For a continuous variable, a |
col_steps |
For a continuous variable, |
facet_axes |
Whether to add interior axes and ticks with |
facet_axis_labels |
Whether to add interior axis labels with |
facet_layout |
Whether the layout is to be |
facet_ncol , facet_nrow
|
The number of columns and rows of facet panels. Only applies to a facet layout of |
facet_scales |
Whether facet scales should be |
facet_space |
When the facet scales are not |
title |
Title string. |
subtitle |
Subtitle string. |
caption |
Caption title string. |
label_case |
A function to format the label of unlabelled variables. Defaults to |
A ggplot object.
library(ggplot2) library(dplyr) set_blanket() economics |> mutate(unemploy_rate = unemploy / pop) |> gg_path( x = unemploy_rate, y = psavert, x_label = "Unemployment rate", y_expand_limits = 0, y_label = "Personal savings rate", )
library(ggplot2) library(dplyr) set_blanket() economics |> mutate(unemploy_rate = unemploy / pop) |> gg_path( x = unemploy_rate, y = psavert, x_label = "Unemployment rate", y_expand_limits = 0, y_label = "Personal savings rate", )
Create a point ggplot with a wrapper around ggplot2::ggplot()
+ geom_point().
gg_point( data = NULL, ..., stat = "identity", position = "identity", coord = ggplot2::coord_cartesian(clip = "off"), theme = NULL, theme_orientation = NULL, theme_axis_line_rm = NULL, theme_axis_ticks_rm = NULL, theme_panel_grid_rm = NULL, blend = NULL, x = NULL, xmin = NULL, xmax = NULL, xend = NULL, y = NULL, ymin = NULL, ymax = NULL, yend = NULL, z = NULL, col = NULL, facet = NULL, facet2 = NULL, group = NULL, subgroup = NULL, label = NULL, text = NULL, sample = NULL, mapping = NULL, x_breaks = NULL, x_breaks_n = NULL, x_expand = NULL, x_expand_limits = NULL, x_label = NULL, x_labels = NULL, x_position = "bottom", x_sec_axis = ggplot2::waiver(), x_symmetric = NULL, x_transform = NULL, y_breaks = NULL, y_breaks_n = NULL, y_expand = NULL, y_expand_limits = NULL, y_label = NULL, y_labels = NULL, y_position = "left", y_sec_axis = ggplot2::waiver(), y_symmetric = NULL, y_transform = NULL, col_breaks = NULL, col_breaks_n = 5, col_drop = FALSE, col_expand_limits = NULL, col_label = NULL, col_labels = NULL, col_legend_ncol = NULL, col_legend_nrow = NULL, col_legend_rev = FALSE, col_palette = NULL, col_palette_na = NULL, col_rescale = scales::rescale(), col_steps = FALSE, col_transform = NULL, facet_axes = NULL, facet_axis_labels = "margins", facet_drop = FALSE, facet_labels = NULL, facet_layout = NULL, facet_ncol = NULL, facet_nrow = NULL, facet_scales = "fixed", facet_space = "fixed", title = NULL, subtitle = NULL, caption = NULL, label_case = NULL )
gg_point( data = NULL, ..., stat = "identity", position = "identity", coord = ggplot2::coord_cartesian(clip = "off"), theme = NULL, theme_orientation = NULL, theme_axis_line_rm = NULL, theme_axis_ticks_rm = NULL, theme_panel_grid_rm = NULL, blend = NULL, x = NULL, xmin = NULL, xmax = NULL, xend = NULL, y = NULL, ymin = NULL, ymax = NULL, yend = NULL, z = NULL, col = NULL, facet = NULL, facet2 = NULL, group = NULL, subgroup = NULL, label = NULL, text = NULL, sample = NULL, mapping = NULL, x_breaks = NULL, x_breaks_n = NULL, x_expand = NULL, x_expand_limits = NULL, x_label = NULL, x_labels = NULL, x_position = "bottom", x_sec_axis = ggplot2::waiver(), x_symmetric = NULL, x_transform = NULL, y_breaks = NULL, y_breaks_n = NULL, y_expand = NULL, y_expand_limits = NULL, y_label = NULL, y_labels = NULL, y_position = "left", y_sec_axis = ggplot2::waiver(), y_symmetric = NULL, y_transform = NULL, col_breaks = NULL, col_breaks_n = 5, col_drop = FALSE, col_expand_limits = NULL, col_label = NULL, col_labels = NULL, col_legend_ncol = NULL, col_legend_nrow = NULL, col_legend_rev = FALSE, col_palette = NULL, col_palette_na = NULL, col_rescale = scales::rescale(), col_steps = FALSE, col_transform = NULL, facet_axes = NULL, facet_axis_labels = "margins", facet_drop = FALSE, facet_labels = NULL, facet_layout = NULL, facet_ncol = NULL, facet_nrow = NULL, facet_scales = "fixed", facet_space = "fixed", title = NULL, subtitle = NULL, caption = NULL, label_case = NULL )
data |
A data frame or tibble. |
... |
Other arguments passed to within a |
stat |
A statistical transformation to use on the data. A snakecase character string of a ggproto Stat subclass object minus the Stat prefix (e.g. |
position |
A position adjustment. A snakecase character string of a ggproto Position subclass object minus the Position prefix (e.g. |
coord |
A coordinate system. A |
theme |
A ggplot2 theme (e.g. |
theme_orientation |
The orientation of plot, which affects the theme components that are removed. Either |
theme_axis_line_rm |
|
theme_axis_ticks_rm |
|
theme_panel_grid_rm |
|
blend |
The blending mode per |
x , xmin , xmax , xend , y , ymin , ymax , yend , z , col , facet , facet2 , group , subgroup , label , text , sample
|
An unquoted aesthetic variable. |
mapping |
A set of additional aesthetic mappings in |
x_breaks , y_breaks , col_breaks
|
A |
x_breaks_n , y_breaks_n , col_breaks_n
|
A number of desired breaks for when |
x_expand , y_expand
|
Padding to the limits with the |
x_expand_limits , y_expand_limits , col_expand_limits
|
For a continuous variable, any values that the limits should encompass (e.g. |
x_label , y_label , col_label
|
Label for the axis or legend title. Use |
x_labels , y_labels , col_labels , facet_labels
|
A function that takes the breaks as inputs (e.g. |
x_position , y_position
|
The position of the axis (i.e. |
x_sec_axis , y_sec_axis
|
A secondary axis with |
x_symmetric , y_symmetric
|
|
x_transform , y_transform , col_transform
|
For a continuous scale, a transformation object (e.g. |
col_drop , facet_drop
|
For a discrete variable, FALSE or TRUE of whether to drop unused levels. |
col_legend_ncol , col_legend_nrow
|
The number of columns and rows in a legend guide. |
col_legend_rev |
|
col_palette |
A character vector of hex codes (or names) or a |
col_palette_na |
A hex code (or name) for the colour of |
col_rescale |
For a continuous variable, a |
col_steps |
For a continuous variable, |
facet_axes |
Whether to add interior axes and ticks with |
facet_axis_labels |
Whether to add interior axis labels with |
facet_layout |
Whether the layout is to be |
facet_ncol , facet_nrow
|
The number of columns and rows of facet panels. Only applies to a facet layout of |
facet_scales |
Whether facet scales should be |
facet_space |
When the facet scales are not |
title |
Title string. |
subtitle |
Subtitle string. |
caption |
Caption title string. |
label_case |
A function to format the label of unlabelled variables. Defaults to |
A ggplot object.
library(ggplot2) library(dplyr) library(palmerpenguins) set_blanket() penguins |> gg_point( x = flipper_length_mm, y = body_mass_g, col = species, )
library(ggplot2) library(dplyr) library(palmerpenguins) set_blanket() penguins |> gg_point( x = flipper_length_mm, y = body_mass_g, col = species, )
Create a pointrange ggplot with a wrapper around ggplot2::ggplot()
+ geom_pointrange().
gg_pointrange( data = NULL, ..., stat = "identity", position = "identity", coord = ggplot2::coord_cartesian(clip = "off"), theme = NULL, theme_orientation = NULL, theme_axis_line_rm = NULL, theme_axis_ticks_rm = NULL, theme_panel_grid_rm = NULL, blend = NULL, x = NULL, xmin = NULL, xmax = NULL, xend = NULL, y = NULL, ymin = NULL, ymax = NULL, yend = NULL, z = NULL, col = NULL, facet = NULL, facet2 = NULL, group = NULL, subgroup = NULL, label = NULL, text = NULL, sample = NULL, mapping = NULL, x_breaks = NULL, x_breaks_n = NULL, x_expand = NULL, x_expand_limits = NULL, x_label = NULL, x_labels = NULL, x_position = "bottom", x_sec_axis = ggplot2::waiver(), x_symmetric = NULL, x_transform = NULL, y_breaks = NULL, y_breaks_n = NULL, y_expand = NULL, y_expand_limits = NULL, y_label = NULL, y_labels = NULL, y_position = "left", y_sec_axis = ggplot2::waiver(), y_symmetric = NULL, y_transform = NULL, col_breaks = NULL, col_breaks_n = 5, col_drop = FALSE, col_expand_limits = NULL, col_label = NULL, col_labels = NULL, col_legend_ncol = NULL, col_legend_nrow = NULL, col_legend_rev = FALSE, col_palette = NULL, col_palette_na = NULL, col_rescale = scales::rescale(), col_steps = FALSE, col_transform = NULL, facet_axes = NULL, facet_axis_labels = "margins", facet_drop = FALSE, facet_labels = NULL, facet_layout = NULL, facet_ncol = NULL, facet_nrow = NULL, facet_scales = "fixed", facet_space = "fixed", title = NULL, subtitle = NULL, caption = NULL, label_case = NULL )
gg_pointrange( data = NULL, ..., stat = "identity", position = "identity", coord = ggplot2::coord_cartesian(clip = "off"), theme = NULL, theme_orientation = NULL, theme_axis_line_rm = NULL, theme_axis_ticks_rm = NULL, theme_panel_grid_rm = NULL, blend = NULL, x = NULL, xmin = NULL, xmax = NULL, xend = NULL, y = NULL, ymin = NULL, ymax = NULL, yend = NULL, z = NULL, col = NULL, facet = NULL, facet2 = NULL, group = NULL, subgroup = NULL, label = NULL, text = NULL, sample = NULL, mapping = NULL, x_breaks = NULL, x_breaks_n = NULL, x_expand = NULL, x_expand_limits = NULL, x_label = NULL, x_labels = NULL, x_position = "bottom", x_sec_axis = ggplot2::waiver(), x_symmetric = NULL, x_transform = NULL, y_breaks = NULL, y_breaks_n = NULL, y_expand = NULL, y_expand_limits = NULL, y_label = NULL, y_labels = NULL, y_position = "left", y_sec_axis = ggplot2::waiver(), y_symmetric = NULL, y_transform = NULL, col_breaks = NULL, col_breaks_n = 5, col_drop = FALSE, col_expand_limits = NULL, col_label = NULL, col_labels = NULL, col_legend_ncol = NULL, col_legend_nrow = NULL, col_legend_rev = FALSE, col_palette = NULL, col_palette_na = NULL, col_rescale = scales::rescale(), col_steps = FALSE, col_transform = NULL, facet_axes = NULL, facet_axis_labels = "margins", facet_drop = FALSE, facet_labels = NULL, facet_layout = NULL, facet_ncol = NULL, facet_nrow = NULL, facet_scales = "fixed", facet_space = "fixed", title = NULL, subtitle = NULL, caption = NULL, label_case = NULL )
data |
A data frame or tibble. |
... |
Other arguments passed to within a |
stat |
A statistical transformation to use on the data. A snakecase character string of a ggproto Stat subclass object minus the Stat prefix (e.g. |
position |
A position adjustment. A snakecase character string of a ggproto Position subclass object minus the Position prefix (e.g. |
coord |
A coordinate system. A |
theme |
A ggplot2 theme (e.g. |
theme_orientation |
The orientation of plot, which affects the theme components that are removed. Either |
theme_axis_line_rm |
|
theme_axis_ticks_rm |
|
theme_panel_grid_rm |
|
blend |
The blending mode per |
x , xmin , xmax , xend , y , ymin , ymax , yend , z , col , facet , facet2 , group , subgroup , label , text , sample
|
An unquoted aesthetic variable. |
mapping |
A set of additional aesthetic mappings in |
x_breaks , y_breaks , col_breaks
|
A |
x_breaks_n , y_breaks_n , col_breaks_n
|
A number of desired breaks for when |
x_expand , y_expand
|
Padding to the limits with the |
x_expand_limits , y_expand_limits , col_expand_limits
|
For a continuous variable, any values that the limits should encompass (e.g. |
x_label , y_label , col_label
|
Label for the axis or legend title. Use |
x_labels , y_labels , col_labels , facet_labels
|
A function that takes the breaks as inputs (e.g. |
x_position , y_position
|
The position of the axis (i.e. |
x_sec_axis , y_sec_axis
|
A secondary axis with |
x_symmetric , y_symmetric
|
|
x_transform , y_transform , col_transform
|
For a continuous scale, a transformation object (e.g. |
col_drop , facet_drop
|
For a discrete variable, FALSE or TRUE of whether to drop unused levels. |
col_legend_ncol , col_legend_nrow
|
The number of columns and rows in a legend guide. |
col_legend_rev |
|
col_palette |
A character vector of hex codes (or names) or a |
col_palette_na |
A hex code (or name) for the colour of |
col_rescale |
For a continuous variable, a |
col_steps |
For a continuous variable, |
facet_axes |
Whether to add interior axes and ticks with |
facet_axis_labels |
Whether to add interior axis labels with |
facet_layout |
Whether the layout is to be |
facet_ncol , facet_nrow
|
The number of columns and rows of facet panels. Only applies to a facet layout of |
facet_scales |
Whether facet scales should be |
facet_space |
When the facet scales are not |
title |
Title string. |
subtitle |
Subtitle string. |
caption |
Caption title string. |
label_case |
A function to format the label of unlabelled variables. Defaults to |
A ggplot object.
library(ggplot2) library(dplyr) set_blanket() data.frame( trt = factor(c(1, 1, 2, 2)), resp = c(1, 5, 3, 4), group = factor(c(1, 2, 1, 2)), upper = c(1.1, 5.3, 3.3, 4.2), lower = c(0.8, 4.6, 2.4, 3.6) ) |> gg_pointrange( x = trt, y = resp, col = group, ymin = lower, ymax = upper, position = position_dodge(width = 0.2), x_label = "Treatment", y_label = "Response", )
library(ggplot2) library(dplyr) set_blanket() data.frame( trt = factor(c(1, 1, 2, 2)), resp = c(1, 5, 3, 4), group = factor(c(1, 2, 1, 2)), upper = c(1.1, 5.3, 3.3, 4.2), lower = c(0.8, 4.6, 2.4, 3.6) ) |> gg_pointrange( x = trt, y = resp, col = group, ymin = lower, ymax = upper, position = position_dodge(width = 0.2), x_label = "Treatment", y_label = "Response", )
Create a polygon ggplot with a wrapper around ggplot2::ggplot()
+ geom_polygon().
gg_polygon( data = NULL, ..., stat = "identity", position = "identity", coord = ggplot2::coord_cartesian(clip = "off"), theme = NULL, theme_orientation = NULL, theme_axis_line_rm = NULL, theme_axis_ticks_rm = NULL, theme_panel_grid_rm = NULL, blend = NULL, x = NULL, xmin = NULL, xmax = NULL, xend = NULL, y = NULL, ymin = NULL, ymax = NULL, yend = NULL, z = NULL, col = NULL, facet = NULL, facet2 = NULL, group = NULL, subgroup = NULL, label = NULL, text = NULL, sample = NULL, mapping = NULL, x_breaks = NULL, x_breaks_n = NULL, x_expand = NULL, x_expand_limits = NULL, x_label = NULL, x_labels = NULL, x_position = "bottom", x_sec_axis = ggplot2::waiver(), x_symmetric = NULL, x_transform = NULL, y_breaks = NULL, y_breaks_n = NULL, y_expand = NULL, y_expand_limits = NULL, y_label = NULL, y_labels = NULL, y_position = "left", y_sec_axis = ggplot2::waiver(), y_symmetric = NULL, y_transform = NULL, col_breaks = NULL, col_breaks_n = 5, col_drop = FALSE, col_expand_limits = NULL, col_label = NULL, col_labels = NULL, col_legend_ncol = NULL, col_legend_nrow = NULL, col_legend_rev = FALSE, col_palette = NULL, col_palette_na = NULL, col_rescale = scales::rescale(), col_steps = FALSE, col_transform = NULL, facet_axes = NULL, facet_axis_labels = "margins", facet_drop = FALSE, facet_labels = NULL, facet_layout = NULL, facet_ncol = NULL, facet_nrow = NULL, facet_scales = "fixed", facet_space = "fixed", title = NULL, subtitle = NULL, caption = NULL, label_case = NULL )
gg_polygon( data = NULL, ..., stat = "identity", position = "identity", coord = ggplot2::coord_cartesian(clip = "off"), theme = NULL, theme_orientation = NULL, theme_axis_line_rm = NULL, theme_axis_ticks_rm = NULL, theme_panel_grid_rm = NULL, blend = NULL, x = NULL, xmin = NULL, xmax = NULL, xend = NULL, y = NULL, ymin = NULL, ymax = NULL, yend = NULL, z = NULL, col = NULL, facet = NULL, facet2 = NULL, group = NULL, subgroup = NULL, label = NULL, text = NULL, sample = NULL, mapping = NULL, x_breaks = NULL, x_breaks_n = NULL, x_expand = NULL, x_expand_limits = NULL, x_label = NULL, x_labels = NULL, x_position = "bottom", x_sec_axis = ggplot2::waiver(), x_symmetric = NULL, x_transform = NULL, y_breaks = NULL, y_breaks_n = NULL, y_expand = NULL, y_expand_limits = NULL, y_label = NULL, y_labels = NULL, y_position = "left", y_sec_axis = ggplot2::waiver(), y_symmetric = NULL, y_transform = NULL, col_breaks = NULL, col_breaks_n = 5, col_drop = FALSE, col_expand_limits = NULL, col_label = NULL, col_labels = NULL, col_legend_ncol = NULL, col_legend_nrow = NULL, col_legend_rev = FALSE, col_palette = NULL, col_palette_na = NULL, col_rescale = scales::rescale(), col_steps = FALSE, col_transform = NULL, facet_axes = NULL, facet_axis_labels = "margins", facet_drop = FALSE, facet_labels = NULL, facet_layout = NULL, facet_ncol = NULL, facet_nrow = NULL, facet_scales = "fixed", facet_space = "fixed", title = NULL, subtitle = NULL, caption = NULL, label_case = NULL )
data |
A data frame or tibble. |
... |
Other arguments passed to within a |
stat |
A statistical transformation to use on the data. A snakecase character string of a ggproto Stat subclass object minus the Stat prefix (e.g. |
position |
A position adjustment. A snakecase character string of a ggproto Position subclass object minus the Position prefix (e.g. |
coord |
A coordinate system. A |
theme |
A ggplot2 theme (e.g. |
theme_orientation |
The orientation of plot, which affects the theme components that are removed. Either |
theme_axis_line_rm |
|
theme_axis_ticks_rm |
|
theme_panel_grid_rm |
|
blend |
The blending mode per |
x , xmin , xmax , xend , y , ymin , ymax , yend , z , col , facet , facet2 , group , subgroup , label , text , sample
|
An unquoted aesthetic variable. |
mapping |
A set of additional aesthetic mappings in |
x_breaks , y_breaks , col_breaks
|
A |
x_breaks_n , y_breaks_n , col_breaks_n
|
A number of desired breaks for when |
x_expand , y_expand
|
Padding to the limits with the |
x_expand_limits , y_expand_limits , col_expand_limits
|
For a continuous variable, any values that the limits should encompass (e.g. |
x_label , y_label , col_label
|
Label for the axis or legend title. Use |
x_labels , y_labels , col_labels , facet_labels
|
A function that takes the breaks as inputs (e.g. |
x_position , y_position
|
The position of the axis (i.e. |
x_sec_axis , y_sec_axis
|
A secondary axis with |
x_symmetric , y_symmetric
|
|
x_transform , y_transform , col_transform
|
For a continuous scale, a transformation object (e.g. |
col_drop , facet_drop
|
For a discrete variable, FALSE or TRUE of whether to drop unused levels. |
col_legend_ncol , col_legend_nrow
|
The number of columns and rows in a legend guide. |
col_legend_rev |
|
col_palette |
A character vector of hex codes (or names) or a |
col_palette_na |
A hex code (or name) for the colour of |
col_rescale |
For a continuous variable, a |
col_steps |
For a continuous variable, |
facet_axes |
Whether to add interior axes and ticks with |
facet_axis_labels |
Whether to add interior axis labels with |
facet_layout |
Whether the layout is to be |
facet_ncol , facet_nrow
|
The number of columns and rows of facet panels. Only applies to a facet layout of |
facet_scales |
Whether facet scales should be |
facet_space |
When the facet scales are not |
title |
Title string. |
subtitle |
Subtitle string. |
caption |
Caption title string. |
label_case |
A function to format the label of unlabelled variables. Defaults to |
A ggplot object.
library(ggplot2) library(dplyr) set_blanket() ids <- factor(c("1.1", "2.1", "1.2", "2.2", "1.3", "2.3")) values <- data.frame( id = ids, value = c(3, 3.1, 3.1, 3.2, 3.15, 3.5) ) positions <- data.frame( id = rep(ids, each = 4), x = c( 2, 1, 1.1, 2.2, 1, 0, 0.3, 1.1, 2.2, 1.1, 1.2, 2.5, 1.1, 0.3, 0.5, 1.2, 2.5, 1.2, 1.3, 2.7, 1.2, 0.5, 0.6, 1.3 ), y = c( -0.5, 0, 1, 0.5, 0, 0.5, 1.5, 1, 0.5, 1, 2.1, 1.7, 1, 1.5, 2.2, 2.1, 1.7, 2.1, 3.2, 2.8, 2.1, 2.2, 3.3, 3.2 ) ) datapoly <- merge(values, positions, by = c("id")) datapoly |> gg_polygon( x = x, y = y, col = value, group = id, )
library(ggplot2) library(dplyr) set_blanket() ids <- factor(c("1.1", "2.1", "1.2", "2.2", "1.3", "2.3")) values <- data.frame( id = ids, value = c(3, 3.1, 3.1, 3.2, 3.15, 3.5) ) positions <- data.frame( id = rep(ids, each = 4), x = c( 2, 1, 1.1, 2.2, 1, 0, 0.3, 1.1, 2.2, 1.1, 1.2, 2.5, 1.1, 0.3, 0.5, 1.2, 2.5, 1.2, 1.3, 2.7, 1.2, 0.5, 0.6, 1.3 ), y = c( -0.5, 0, 1, 0.5, 0, 0.5, 1.5, 1, 0.5, 1, 2.1, 1.7, 1, 1.5, 2.2, 2.1, 1.7, 2.1, 3.2, 2.8, 2.1, 2.2, 3.3, 3.2 ) ) datapoly <- merge(values, positions, by = c("id")) datapoly |> gg_polygon( x = x, y = y, col = value, group = id, )
Create a qq ggplot with a wrapper around ggplot2::ggplot()
+ geom_qq().
gg_qq( data = NULL, ..., stat = "qq", position = "identity", coord = ggplot2::coord_cartesian(clip = "off"), theme = NULL, theme_orientation = NULL, theme_axis_line_rm = NULL, theme_axis_ticks_rm = NULL, theme_panel_grid_rm = NULL, blend = NULL, x = NULL, xmin = NULL, xmax = NULL, xend = NULL, y = NULL, ymin = NULL, ymax = NULL, yend = NULL, z = NULL, col = NULL, facet = NULL, facet2 = NULL, group = NULL, subgroup = NULL, label = NULL, text = NULL, sample = NULL, mapping = NULL, x_breaks = NULL, x_breaks_n = NULL, x_expand = NULL, x_expand_limits = NULL, x_label = NULL, x_labels = NULL, x_position = "bottom", x_sec_axis = ggplot2::waiver(), x_symmetric = NULL, x_transform = NULL, y_breaks = NULL, y_breaks_n = NULL, y_expand = NULL, y_expand_limits = NULL, y_label = NULL, y_labels = NULL, y_position = "left", y_sec_axis = ggplot2::waiver(), y_symmetric = NULL, y_transform = NULL, col_breaks = NULL, col_breaks_n = 5, col_drop = FALSE, col_expand_limits = NULL, col_label = NULL, col_labels = NULL, col_legend_ncol = NULL, col_legend_nrow = NULL, col_legend_rev = FALSE, col_palette = NULL, col_palette_na = NULL, col_rescale = scales::rescale(), col_steps = FALSE, col_transform = NULL, facet_axes = NULL, facet_axis_labels = "margins", facet_drop = FALSE, facet_labels = NULL, facet_layout = NULL, facet_ncol = NULL, facet_nrow = NULL, facet_scales = "fixed", facet_space = "fixed", title = NULL, subtitle = NULL, caption = NULL, label_case = NULL )
gg_qq( data = NULL, ..., stat = "qq", position = "identity", coord = ggplot2::coord_cartesian(clip = "off"), theme = NULL, theme_orientation = NULL, theme_axis_line_rm = NULL, theme_axis_ticks_rm = NULL, theme_panel_grid_rm = NULL, blend = NULL, x = NULL, xmin = NULL, xmax = NULL, xend = NULL, y = NULL, ymin = NULL, ymax = NULL, yend = NULL, z = NULL, col = NULL, facet = NULL, facet2 = NULL, group = NULL, subgroup = NULL, label = NULL, text = NULL, sample = NULL, mapping = NULL, x_breaks = NULL, x_breaks_n = NULL, x_expand = NULL, x_expand_limits = NULL, x_label = NULL, x_labels = NULL, x_position = "bottom", x_sec_axis = ggplot2::waiver(), x_symmetric = NULL, x_transform = NULL, y_breaks = NULL, y_breaks_n = NULL, y_expand = NULL, y_expand_limits = NULL, y_label = NULL, y_labels = NULL, y_position = "left", y_sec_axis = ggplot2::waiver(), y_symmetric = NULL, y_transform = NULL, col_breaks = NULL, col_breaks_n = 5, col_drop = FALSE, col_expand_limits = NULL, col_label = NULL, col_labels = NULL, col_legend_ncol = NULL, col_legend_nrow = NULL, col_legend_rev = FALSE, col_palette = NULL, col_palette_na = NULL, col_rescale = scales::rescale(), col_steps = FALSE, col_transform = NULL, facet_axes = NULL, facet_axis_labels = "margins", facet_drop = FALSE, facet_labels = NULL, facet_layout = NULL, facet_ncol = NULL, facet_nrow = NULL, facet_scales = "fixed", facet_space = "fixed", title = NULL, subtitle = NULL, caption = NULL, label_case = NULL )
data |
A data frame or tibble. |
... |
Other arguments passed to within a |
stat |
A statistical transformation to use on the data. A snakecase character string of a ggproto Stat subclass object minus the Stat prefix (e.g. |
position |
A position adjustment. A snakecase character string of a ggproto Position subclass object minus the Position prefix (e.g. |
coord |
A coordinate system. A |
theme |
A ggplot2 theme (e.g. |
theme_orientation |
The orientation of plot, which affects the theme components that are removed. Either |
theme_axis_line_rm |
|
theme_axis_ticks_rm |
|
theme_panel_grid_rm |
|
blend |
The blending mode per |
x , xmin , xmax , xend , y , ymin , ymax , yend , z , col , facet , facet2 , group , subgroup , label , text , sample
|
An unquoted aesthetic variable. |
mapping |
A set of additional aesthetic mappings in |
x_breaks , y_breaks , col_breaks
|
A |
x_breaks_n , y_breaks_n , col_breaks_n
|
A number of desired breaks for when |
x_expand , y_expand
|
Padding to the limits with the |
x_expand_limits , y_expand_limits , col_expand_limits
|
For a continuous variable, any values that the limits should encompass (e.g. |
x_label , y_label , col_label
|
Label for the axis or legend title. Use |
x_labels , y_labels , col_labels , facet_labels
|
A function that takes the breaks as inputs (e.g. |
x_position , y_position
|
The position of the axis (i.e. |
x_sec_axis , y_sec_axis
|
A secondary axis with |
x_symmetric , y_symmetric
|
|
x_transform , y_transform , col_transform
|
For a continuous scale, a transformation object (e.g. |
col_drop , facet_drop
|
For a discrete variable, FALSE or TRUE of whether to drop unused levels. |
col_legend_ncol , col_legend_nrow
|
The number of columns and rows in a legend guide. |
col_legend_rev |
|
col_palette |
A character vector of hex codes (or names) or a |
col_palette_na |
A hex code (or name) for the colour of |
col_rescale |
For a continuous variable, a |
col_steps |
For a continuous variable, |
facet_axes |
Whether to add interior axes and ticks with |
facet_axis_labels |
Whether to add interior axis labels with |
facet_layout |
Whether the layout is to be |
facet_ncol , facet_nrow
|
The number of columns and rows of facet panels. Only applies to a facet layout of |
facet_scales |
Whether facet scales should be |
facet_space |
When the facet scales are not |
title |
Title string. |
subtitle |
Subtitle string. |
caption |
Caption title string. |
label_case |
A function to format the label of unlabelled variables. Defaults to |
A ggplot object.
library(ggplot2) library(dplyr) library(palmerpenguins) set_blanket() penguins |> gg_qq( sample = body_mass_g, facet = species, coord = coord_cartesian(clip = "on"), ) + geom_qq_line()
library(ggplot2) library(dplyr) library(palmerpenguins) set_blanket() penguins |> gg_qq( sample = body_mass_g, facet = species, coord = coord_cartesian(clip = "on"), ) + geom_qq_line()
Create an quantile ggplot with a wrapper around ggplot2::ggplot()
+ geom_quantile().
gg_quantile( data = NULL, ..., stat = "quantile", position = "identity", coord = ggplot2::coord_cartesian(clip = "off"), theme = NULL, theme_orientation = NULL, theme_axis_line_rm = NULL, theme_axis_ticks_rm = NULL, theme_panel_grid_rm = NULL, blend = NULL, x = NULL, xmin = NULL, xmax = NULL, xend = NULL, y = NULL, ymin = NULL, ymax = NULL, yend = NULL, z = NULL, col = NULL, facet = NULL, facet2 = NULL, group = NULL, subgroup = NULL, label = NULL, text = NULL, sample = NULL, mapping = NULL, x_breaks = NULL, x_breaks_n = NULL, x_expand = NULL, x_expand_limits = NULL, x_label = NULL, x_labels = NULL, x_position = "bottom", x_sec_axis = ggplot2::waiver(), x_symmetric = NULL, x_transform = NULL, y_breaks = NULL, y_breaks_n = NULL, y_expand = NULL, y_expand_limits = NULL, y_label = NULL, y_labels = NULL, y_position = "left", y_sec_axis = ggplot2::waiver(), y_symmetric = NULL, y_transform = NULL, col_breaks = NULL, col_breaks_n = 5, col_drop = FALSE, col_expand_limits = NULL, col_label = NULL, col_labels = NULL, col_legend_ncol = NULL, col_legend_nrow = NULL, col_legend_rev = FALSE, col_palette = NULL, col_palette_na = NULL, col_rescale = scales::rescale(), col_steps = FALSE, col_transform = NULL, facet_axes = NULL, facet_axis_labels = "margins", facet_drop = FALSE, facet_labels = NULL, facet_layout = NULL, facet_ncol = NULL, facet_nrow = NULL, facet_scales = "fixed", facet_space = "fixed", title = NULL, subtitle = NULL, caption = NULL, label_case = NULL )
gg_quantile( data = NULL, ..., stat = "quantile", position = "identity", coord = ggplot2::coord_cartesian(clip = "off"), theme = NULL, theme_orientation = NULL, theme_axis_line_rm = NULL, theme_axis_ticks_rm = NULL, theme_panel_grid_rm = NULL, blend = NULL, x = NULL, xmin = NULL, xmax = NULL, xend = NULL, y = NULL, ymin = NULL, ymax = NULL, yend = NULL, z = NULL, col = NULL, facet = NULL, facet2 = NULL, group = NULL, subgroup = NULL, label = NULL, text = NULL, sample = NULL, mapping = NULL, x_breaks = NULL, x_breaks_n = NULL, x_expand = NULL, x_expand_limits = NULL, x_label = NULL, x_labels = NULL, x_position = "bottom", x_sec_axis = ggplot2::waiver(), x_symmetric = NULL, x_transform = NULL, y_breaks = NULL, y_breaks_n = NULL, y_expand = NULL, y_expand_limits = NULL, y_label = NULL, y_labels = NULL, y_position = "left", y_sec_axis = ggplot2::waiver(), y_symmetric = NULL, y_transform = NULL, col_breaks = NULL, col_breaks_n = 5, col_drop = FALSE, col_expand_limits = NULL, col_label = NULL, col_labels = NULL, col_legend_ncol = NULL, col_legend_nrow = NULL, col_legend_rev = FALSE, col_palette = NULL, col_palette_na = NULL, col_rescale = scales::rescale(), col_steps = FALSE, col_transform = NULL, facet_axes = NULL, facet_axis_labels = "margins", facet_drop = FALSE, facet_labels = NULL, facet_layout = NULL, facet_ncol = NULL, facet_nrow = NULL, facet_scales = "fixed", facet_space = "fixed", title = NULL, subtitle = NULL, caption = NULL, label_case = NULL )
data |
A data frame or tibble. |
... |
Other arguments passed to within a |
stat |
A statistical transformation to use on the data. A snakecase character string of a ggproto Stat subclass object minus the Stat prefix (e.g. |
position |
A position adjustment. A snakecase character string of a ggproto Position subclass object minus the Position prefix (e.g. |
coord |
A coordinate system. A |
theme |
A ggplot2 theme (e.g. |
theme_orientation |
The orientation of plot, which affects the theme components that are removed. Either |
theme_axis_line_rm |
|
theme_axis_ticks_rm |
|
theme_panel_grid_rm |
|
blend |
The blending mode per |
x , xmin , xmax , xend , y , ymin , ymax , yend , z , col , facet , facet2 , group , subgroup , label , text , sample
|
An unquoted aesthetic variable. |
mapping |
A set of additional aesthetic mappings in |
x_breaks , y_breaks , col_breaks
|
A |
x_breaks_n , y_breaks_n , col_breaks_n
|
A number of desired breaks for when |
x_expand , y_expand
|
Padding to the limits with the |
x_expand_limits , y_expand_limits , col_expand_limits
|
For a continuous variable, any values that the limits should encompass (e.g. |
x_label , y_label , col_label
|
Label for the axis or legend title. Use |
x_labels , y_labels , col_labels , facet_labels
|
A function that takes the breaks as inputs (e.g. |
x_position , y_position
|
The position of the axis (i.e. |
x_sec_axis , y_sec_axis
|
A secondary axis with |
x_symmetric , y_symmetric
|
|
x_transform , y_transform , col_transform
|
For a continuous scale, a transformation object (e.g. |
col_drop , facet_drop
|
For a discrete variable, FALSE or TRUE of whether to drop unused levels. |
col_legend_ncol , col_legend_nrow
|
The number of columns and rows in a legend guide. |
col_legend_rev |
|
col_palette |
A character vector of hex codes (or names) or a |
col_palette_na |
A hex code (or name) for the colour of |
col_rescale |
For a continuous variable, a |
col_steps |
For a continuous variable, |
facet_axes |
Whether to add interior axes and ticks with |
facet_axis_labels |
Whether to add interior axis labels with |
facet_layout |
Whether the layout is to be |
facet_ncol , facet_nrow
|
The number of columns and rows of facet panels. Only applies to a facet layout of |
facet_scales |
Whether facet scales should be |
facet_space |
When the facet scales are not |
title |
Title string. |
subtitle |
Subtitle string. |
caption |
Caption title string. |
label_case |
A function to format the label of unlabelled variables. Defaults to |
A ggplot object.
if (requireNamespace("quantreg", quietly = TRUE)) { library(ggplot2) library(palmerpenguins) set_blanket() penguins |> gg_quantile( x = flipper_length_mm, y = body_mass_g, ) }
if (requireNamespace("quantreg", quietly = TRUE)) { library(ggplot2) library(palmerpenguins) set_blanket() penguins |> gg_quantile( x = flipper_length_mm, y = body_mass_g, ) }
Create a raster ggplot with a wrapper around ggplot2::ggplot()
+ geom_raster().
gg_raster( data = NULL, ..., stat = "identity", position = "identity", coord = ggplot2::coord_cartesian(clip = "off"), theme = NULL, theme_orientation = NULL, theme_axis_line_rm = NULL, theme_axis_ticks_rm = NULL, theme_panel_grid_rm = NULL, blend = NULL, x = NULL, xmin = NULL, xmax = NULL, xend = NULL, y = NULL, ymin = NULL, ymax = NULL, yend = NULL, z = NULL, col = NULL, facet = NULL, facet2 = NULL, group = NULL, subgroup = NULL, label = NULL, text = NULL, sample = NULL, mapping = NULL, x_breaks = NULL, x_breaks_n = NULL, x_expand = NULL, x_expand_limits = NULL, x_label = NULL, x_labels = NULL, x_position = "bottom", x_sec_axis = ggplot2::waiver(), x_symmetric = NULL, x_transform = NULL, y_breaks = NULL, y_breaks_n = NULL, y_expand = NULL, y_expand_limits = NULL, y_label = NULL, y_labels = NULL, y_position = "left", y_sec_axis = ggplot2::waiver(), y_symmetric = NULL, y_transform = NULL, col_breaks = NULL, col_breaks_n = 5, col_drop = FALSE, col_expand_limits = NULL, col_label = NULL, col_labels = NULL, col_legend_ncol = NULL, col_legend_nrow = NULL, col_legend_rev = FALSE, col_palette = NULL, col_palette_na = NULL, col_rescale = scales::rescale(), col_steps = FALSE, col_transform = NULL, facet_axes = NULL, facet_axis_labels = "margins", facet_drop = FALSE, facet_labels = NULL, facet_layout = NULL, facet_ncol = NULL, facet_nrow = NULL, facet_scales = "fixed", facet_space = "fixed", title = NULL, subtitle = NULL, caption = NULL, label_case = NULL )
gg_raster( data = NULL, ..., stat = "identity", position = "identity", coord = ggplot2::coord_cartesian(clip = "off"), theme = NULL, theme_orientation = NULL, theme_axis_line_rm = NULL, theme_axis_ticks_rm = NULL, theme_panel_grid_rm = NULL, blend = NULL, x = NULL, xmin = NULL, xmax = NULL, xend = NULL, y = NULL, ymin = NULL, ymax = NULL, yend = NULL, z = NULL, col = NULL, facet = NULL, facet2 = NULL, group = NULL, subgroup = NULL, label = NULL, text = NULL, sample = NULL, mapping = NULL, x_breaks = NULL, x_breaks_n = NULL, x_expand = NULL, x_expand_limits = NULL, x_label = NULL, x_labels = NULL, x_position = "bottom", x_sec_axis = ggplot2::waiver(), x_symmetric = NULL, x_transform = NULL, y_breaks = NULL, y_breaks_n = NULL, y_expand = NULL, y_expand_limits = NULL, y_label = NULL, y_labels = NULL, y_position = "left", y_sec_axis = ggplot2::waiver(), y_symmetric = NULL, y_transform = NULL, col_breaks = NULL, col_breaks_n = 5, col_drop = FALSE, col_expand_limits = NULL, col_label = NULL, col_labels = NULL, col_legend_ncol = NULL, col_legend_nrow = NULL, col_legend_rev = FALSE, col_palette = NULL, col_palette_na = NULL, col_rescale = scales::rescale(), col_steps = FALSE, col_transform = NULL, facet_axes = NULL, facet_axis_labels = "margins", facet_drop = FALSE, facet_labels = NULL, facet_layout = NULL, facet_ncol = NULL, facet_nrow = NULL, facet_scales = "fixed", facet_space = "fixed", title = NULL, subtitle = NULL, caption = NULL, label_case = NULL )
data |
A data frame or tibble. |
... |
Other arguments passed to within a |
stat |
A statistical transformation to use on the data. A snakecase character string of a ggproto Stat subclass object minus the Stat prefix (e.g. |
position |
A position adjustment. A snakecase character string of a ggproto Position subclass object minus the Position prefix (e.g. |
coord |
A coordinate system. A |
theme |
A ggplot2 theme (e.g. |
theme_orientation |
The orientation of plot, which affects the theme components that are removed. Either |
theme_axis_line_rm |
|
theme_axis_ticks_rm |
|
theme_panel_grid_rm |
|
blend |
The blending mode per |
x , xmin , xmax , xend , y , ymin , ymax , yend , z , col , facet , facet2 , group , subgroup , label , text , sample
|
An unquoted aesthetic variable. |
mapping |
A set of additional aesthetic mappings in |
x_breaks , y_breaks , col_breaks
|
A |
x_breaks_n , y_breaks_n , col_breaks_n
|
A number of desired breaks for when |
x_expand , y_expand
|
Padding to the limits with the |
x_expand_limits , y_expand_limits , col_expand_limits
|
For a continuous variable, any values that the limits should encompass (e.g. |
x_label , y_label , col_label
|
Label for the axis or legend title. Use |
x_labels , y_labels , col_labels , facet_labels
|
A function that takes the breaks as inputs (e.g. |
x_position , y_position
|
The position of the axis (i.e. |
x_sec_axis , y_sec_axis
|
A secondary axis with |
x_symmetric , y_symmetric
|
|
x_transform , y_transform , col_transform
|
For a continuous scale, a transformation object (e.g. |
col_drop , facet_drop
|
For a discrete variable, FALSE or TRUE of whether to drop unused levels. |
col_legend_ncol , col_legend_nrow
|
The number of columns and rows in a legend guide. |
col_legend_rev |
|
col_palette |
A character vector of hex codes (or names) or a |
col_palette_na |
A hex code (or name) for the colour of |
col_rescale |
For a continuous variable, a |
col_steps |
For a continuous variable, |
facet_axes |
Whether to add interior axes and ticks with |
facet_axis_labels |
Whether to add interior axis labels with |
facet_layout |
Whether the layout is to be |
facet_ncol , facet_nrow
|
The number of columns and rows of facet panels. Only applies to a facet layout of |
facet_scales |
Whether facet scales should be |
facet_space |
When the facet scales are not |
title |
Title string. |
subtitle |
Subtitle string. |
caption |
Caption title string. |
label_case |
A function to format the label of unlabelled variables. Defaults to |
A ggplot object.
library(ggplot2) library(dplyr) set_blanket() faithfuld |> gg_raster( x = waiting, y = eruptions, col = density, )
library(ggplot2) library(dplyr) set_blanket() faithfuld |> gg_raster( x = waiting, y = eruptions, col = density, )
Create a rect ggplot with a wrapper around ggplot2::ggplot()
+ geom_rect().
gg_rect( data = NULL, ..., stat = "identity", position = "identity", coord = ggplot2::coord_cartesian(clip = "off"), theme = NULL, theme_orientation = NULL, theme_axis_line_rm = NULL, theme_axis_ticks_rm = NULL, theme_panel_grid_rm = NULL, blend = NULL, x = NULL, xmin = NULL, xmax = NULL, xend = NULL, y = NULL, ymin = NULL, ymax = NULL, yend = NULL, z = NULL, col = NULL, facet = NULL, facet2 = NULL, group = NULL, subgroup = NULL, label = NULL, text = NULL, sample = NULL, mapping = NULL, x_breaks = NULL, x_breaks_n = NULL, x_expand = NULL, x_expand_limits = NULL, x_label = NULL, x_labels = NULL, x_position = "bottom", x_sec_axis = ggplot2::waiver(), x_symmetric = NULL, x_transform = NULL, y_breaks = NULL, y_breaks_n = NULL, y_expand = NULL, y_expand_limits = NULL, y_label = NULL, y_labels = NULL, y_position = "left", y_sec_axis = ggplot2::waiver(), y_symmetric = NULL, y_transform = NULL, col_breaks = NULL, col_breaks_n = 5, col_drop = FALSE, col_expand_limits = NULL, col_label = NULL, col_labels = NULL, col_legend_ncol = NULL, col_legend_nrow = NULL, col_legend_rev = FALSE, col_palette = NULL, col_palette_na = NULL, col_rescale = scales::rescale(), col_steps = FALSE, col_transform = NULL, facet_axes = NULL, facet_axis_labels = "margins", facet_drop = FALSE, facet_labels = NULL, facet_layout = NULL, facet_ncol = NULL, facet_nrow = NULL, facet_scales = "fixed", facet_space = "fixed", title = NULL, subtitle = NULL, caption = NULL, label_case = NULL )
gg_rect( data = NULL, ..., stat = "identity", position = "identity", coord = ggplot2::coord_cartesian(clip = "off"), theme = NULL, theme_orientation = NULL, theme_axis_line_rm = NULL, theme_axis_ticks_rm = NULL, theme_panel_grid_rm = NULL, blend = NULL, x = NULL, xmin = NULL, xmax = NULL, xend = NULL, y = NULL, ymin = NULL, ymax = NULL, yend = NULL, z = NULL, col = NULL, facet = NULL, facet2 = NULL, group = NULL, subgroup = NULL, label = NULL, text = NULL, sample = NULL, mapping = NULL, x_breaks = NULL, x_breaks_n = NULL, x_expand = NULL, x_expand_limits = NULL, x_label = NULL, x_labels = NULL, x_position = "bottom", x_sec_axis = ggplot2::waiver(), x_symmetric = NULL, x_transform = NULL, y_breaks = NULL, y_breaks_n = NULL, y_expand = NULL, y_expand_limits = NULL, y_label = NULL, y_labels = NULL, y_position = "left", y_sec_axis = ggplot2::waiver(), y_symmetric = NULL, y_transform = NULL, col_breaks = NULL, col_breaks_n = 5, col_drop = FALSE, col_expand_limits = NULL, col_label = NULL, col_labels = NULL, col_legend_ncol = NULL, col_legend_nrow = NULL, col_legend_rev = FALSE, col_palette = NULL, col_palette_na = NULL, col_rescale = scales::rescale(), col_steps = FALSE, col_transform = NULL, facet_axes = NULL, facet_axis_labels = "margins", facet_drop = FALSE, facet_labels = NULL, facet_layout = NULL, facet_ncol = NULL, facet_nrow = NULL, facet_scales = "fixed", facet_space = "fixed", title = NULL, subtitle = NULL, caption = NULL, label_case = NULL )
data |
A data frame or tibble. |
... |
Other arguments passed to within a |
stat |
A statistical transformation to use on the data. A snakecase character string of a ggproto Stat subclass object minus the Stat prefix (e.g. |
position |
A position adjustment. A snakecase character string of a ggproto Position subclass object minus the Position prefix (e.g. |
coord |
A coordinate system. A |
theme |
A ggplot2 theme (e.g. |
theme_orientation |
The orientation of plot, which affects the theme components that are removed. Either |
theme_axis_line_rm |
|
theme_axis_ticks_rm |
|
theme_panel_grid_rm |
|
blend |
The blending mode per |
x , xmin , xmax , xend , y , ymin , ymax , yend , z , col , facet , facet2 , group , subgroup , label , text , sample
|
An unquoted aesthetic variable. |
mapping |
A set of additional aesthetic mappings in |
x_breaks , y_breaks , col_breaks
|
A |
x_breaks_n , y_breaks_n , col_breaks_n
|
A number of desired breaks for when |
x_expand , y_expand
|
Padding to the limits with the |
x_expand_limits , y_expand_limits , col_expand_limits
|
For a continuous variable, any values that the limits should encompass (e.g. |
x_label , y_label , col_label
|
Label for the axis or legend title. Use |
x_labels , y_labels , col_labels , facet_labels
|
A function that takes the breaks as inputs (e.g. |
x_position , y_position
|
The position of the axis (i.e. |
x_sec_axis , y_sec_axis
|
A secondary axis with |
x_symmetric , y_symmetric
|
|
x_transform , y_transform , col_transform
|
For a continuous scale, a transformation object (e.g. |
col_drop , facet_drop
|
For a discrete variable, FALSE or TRUE of whether to drop unused levels. |
col_legend_ncol , col_legend_nrow
|
The number of columns and rows in a legend guide. |
col_legend_rev |
|
col_palette |
A character vector of hex codes (or names) or a |
col_palette_na |
A hex code (or name) for the colour of |
col_rescale |
For a continuous variable, a |
col_steps |
For a continuous variable, |
facet_axes |
Whether to add interior axes and ticks with |
facet_axis_labels |
Whether to add interior axis labels with |
facet_layout |
Whether the layout is to be |
facet_ncol , facet_nrow
|
The number of columns and rows of facet panels. Only applies to a facet layout of |
facet_scales |
Whether facet scales should be |
facet_space |
When the facet scales are not |
title |
Title string. |
subtitle |
Subtitle string. |
caption |
Caption title string. |
label_case |
A function to format the label of unlabelled variables. Defaults to |
A ggplot object.
library(ggplot2) library(dplyr) set_blanket() data.frame( x = rep(c(2, 5, 7, 9, 12), 2), y = rep(c(1, 2), each = 5), z = factor(c(rep(1:4, each = 2), 5, NA)), w = rep(diff(c(0, 4, 6, 8, 10, 14)), 2) ) |> mutate( xmin = x - w / 2, xmax = x + w / 2, ymin = y, ymax = y + 1 ) |> gg_rect( xmin = xmin, xmax = xmax, ymin = ymin, ymax = ymax, col = z, )
library(ggplot2) library(dplyr) set_blanket() data.frame( x = rep(c(2, 5, 7, 9, 12), 2), y = rep(c(1, 2), each = 5), z = factor(c(rep(1:4, each = 2), 5, NA)), w = rep(diff(c(0, 4, 6, 8, 10, 14)), 2) ) |> mutate( xmin = x - w / 2, xmax = x + w / 2, ymin = y, ymax = y + 1 ) |> gg_rect( xmin = xmin, xmax = xmax, ymin = ymin, ymax = ymax, col = z, )
Create a ribbon ggplot with a wrapper around ggplot2::ggplot()
+ geom_ribbon()
gg_ribbon( data = NULL, ..., stat = "identity", position = "identity", coord = ggplot2::coord_cartesian(clip = "off"), theme = NULL, theme_orientation = NULL, theme_axis_line_rm = NULL, theme_axis_ticks_rm = NULL, theme_panel_grid_rm = NULL, blend = NULL, x = NULL, xmin = NULL, xmax = NULL, xend = NULL, y = NULL, ymin = NULL, ymax = NULL, yend = NULL, z = NULL, col = NULL, facet = NULL, facet2 = NULL, group = NULL, subgroup = NULL, label = NULL, text = NULL, sample = NULL, mapping = NULL, x_breaks = NULL, x_breaks_n = NULL, x_expand = NULL, x_expand_limits = NULL, x_label = NULL, x_labels = NULL, x_position = "bottom", x_sec_axis = ggplot2::waiver(), x_symmetric = NULL, x_transform = NULL, y_breaks = NULL, y_breaks_n = NULL, y_expand = NULL, y_expand_limits = NULL, y_label = NULL, y_labels = NULL, y_position = "left", y_sec_axis = ggplot2::waiver(), y_symmetric = NULL, y_transform = NULL, col_breaks = NULL, col_breaks_n = 5, col_drop = FALSE, col_expand_limits = NULL, col_label = NULL, col_labels = NULL, col_legend_ncol = NULL, col_legend_nrow = NULL, col_legend_rev = FALSE, col_palette = NULL, col_palette_na = NULL, col_rescale = scales::rescale(), col_steps = FALSE, col_transform = NULL, facet_axes = NULL, facet_axis_labels = "margins", facet_drop = FALSE, facet_labels = NULL, facet_layout = NULL, facet_ncol = NULL, facet_nrow = NULL, facet_scales = "fixed", facet_space = "fixed", title = NULL, subtitle = NULL, caption = NULL, label_case = NULL )
gg_ribbon( data = NULL, ..., stat = "identity", position = "identity", coord = ggplot2::coord_cartesian(clip = "off"), theme = NULL, theme_orientation = NULL, theme_axis_line_rm = NULL, theme_axis_ticks_rm = NULL, theme_panel_grid_rm = NULL, blend = NULL, x = NULL, xmin = NULL, xmax = NULL, xend = NULL, y = NULL, ymin = NULL, ymax = NULL, yend = NULL, z = NULL, col = NULL, facet = NULL, facet2 = NULL, group = NULL, subgroup = NULL, label = NULL, text = NULL, sample = NULL, mapping = NULL, x_breaks = NULL, x_breaks_n = NULL, x_expand = NULL, x_expand_limits = NULL, x_label = NULL, x_labels = NULL, x_position = "bottom", x_sec_axis = ggplot2::waiver(), x_symmetric = NULL, x_transform = NULL, y_breaks = NULL, y_breaks_n = NULL, y_expand = NULL, y_expand_limits = NULL, y_label = NULL, y_labels = NULL, y_position = "left", y_sec_axis = ggplot2::waiver(), y_symmetric = NULL, y_transform = NULL, col_breaks = NULL, col_breaks_n = 5, col_drop = FALSE, col_expand_limits = NULL, col_label = NULL, col_labels = NULL, col_legend_ncol = NULL, col_legend_nrow = NULL, col_legend_rev = FALSE, col_palette = NULL, col_palette_na = NULL, col_rescale = scales::rescale(), col_steps = FALSE, col_transform = NULL, facet_axes = NULL, facet_axis_labels = "margins", facet_drop = FALSE, facet_labels = NULL, facet_layout = NULL, facet_ncol = NULL, facet_nrow = NULL, facet_scales = "fixed", facet_space = "fixed", title = NULL, subtitle = NULL, caption = NULL, label_case = NULL )
data |
A data frame or tibble. |
... |
Other arguments passed to within a |
stat |
A statistical transformation to use on the data. A snakecase character string of a ggproto Stat subclass object minus the Stat prefix (e.g. |
position |
A position adjustment. A snakecase character string of a ggproto Position subclass object minus the Position prefix (e.g. |
coord |
A coordinate system. A |
theme |
A ggplot2 theme (e.g. |
theme_orientation |
The orientation of plot, which affects the theme components that are removed. Either |
theme_axis_line_rm |
|
theme_axis_ticks_rm |
|
theme_panel_grid_rm |
|
blend |
The blending mode per |
x , xmin , xmax , xend , y , ymin , ymax , yend , z , col , facet , facet2 , group , subgroup , label , text , sample
|
An unquoted aesthetic variable. |
mapping |
A set of additional aesthetic mappings in |
x_breaks , y_breaks , col_breaks
|
A |
x_breaks_n , y_breaks_n , col_breaks_n
|
A number of desired breaks for when |
x_expand , y_expand
|
Padding to the limits with the |
x_expand_limits , y_expand_limits , col_expand_limits
|
For a continuous variable, any values that the limits should encompass (e.g. |
x_label , y_label , col_label
|
Label for the axis or legend title. Use |
x_labels , y_labels , col_labels , facet_labels
|
A function that takes the breaks as inputs (e.g. |
x_position , y_position
|
The position of the axis (i.e. |
x_sec_axis , y_sec_axis
|
A secondary axis with |
x_symmetric , y_symmetric
|
|
x_transform , y_transform , col_transform
|
For a continuous scale, a transformation object (e.g. |
col_drop , facet_drop
|
For a discrete variable, FALSE or TRUE of whether to drop unused levels. |
col_legend_ncol , col_legend_nrow
|
The number of columns and rows in a legend guide. |
col_legend_rev |
|
col_palette |
A character vector of hex codes (or names) or a |
col_palette_na |
A hex code (or name) for the colour of |
col_rescale |
For a continuous variable, a |
col_steps |
For a continuous variable, |
facet_axes |
Whether to add interior axes and ticks with |
facet_axis_labels |
Whether to add interior axis labels with |
facet_layout |
Whether the layout is to be |
facet_ncol , facet_nrow
|
The number of columns and rows of facet panels. Only applies to a facet layout of |
facet_scales |
Whether facet scales should be |
facet_space |
When the facet scales are not |
title |
Title string. |
subtitle |
Subtitle string. |
caption |
Caption title string. |
label_case |
A function to format the label of unlabelled variables. Defaults to |
A ggplot object.
library(ggplot2) library(dplyr) set_blanket() data.frame(year = 1875:1972, level = as.vector(LakeHuron)) |> mutate(level_min = level - 1, level_max = level + 1) |> gg_ribbon( x = year, ymin = level_min, ymax = level_max, x_labels = \(x) x, )
library(ggplot2) library(dplyr) set_blanket() data.frame(year = 1875:1972, level = as.vector(LakeHuron)) |> mutate(level_min = level - 1, level_max = level + 1) |> gg_ribbon( x = year, ymin = level_min, ymax = level_max, x_labels = \(x) x, )
Create a ribbon line ggplot with a wrapper around ggplot2::ggplot()
+ geom_smooth(stat = "identity", ...).
gg_ribbon_line( data = NULL, ..., stat = "identity", position = "identity", coord = ggplot2::coord_cartesian(clip = "off"), theme = NULL, theme_orientation = NULL, theme_axis_line_rm = NULL, theme_axis_ticks_rm = NULL, theme_panel_grid_rm = NULL, blend = NULL, x = NULL, xmin = NULL, xmax = NULL, xend = NULL, y = NULL, ymin = NULL, ymax = NULL, yend = NULL, z = NULL, col = NULL, facet = NULL, facet2 = NULL, group = NULL, subgroup = NULL, label = NULL, text = NULL, sample = NULL, mapping = NULL, x_breaks = NULL, x_breaks_n = NULL, x_expand = NULL, x_expand_limits = NULL, x_label = NULL, x_labels = NULL, x_position = "bottom", x_sec_axis = ggplot2::waiver(), x_symmetric = NULL, x_transform = NULL, y_breaks = NULL, y_breaks_n = NULL, y_expand = NULL, y_expand_limits = NULL, y_label = NULL, y_labels = NULL, y_position = "left", y_sec_axis = ggplot2::waiver(), y_symmetric = NULL, y_transform = NULL, col_breaks = NULL, col_breaks_n = 5, col_drop = FALSE, col_expand_limits = NULL, col_label = NULL, col_labels = NULL, col_legend_ncol = NULL, col_legend_nrow = NULL, col_legend_rev = FALSE, col_palette = NULL, col_palette_na = NULL, col_rescale = scales::rescale(), col_steps = FALSE, col_transform = NULL, facet_axes = NULL, facet_axis_labels = "margins", facet_drop = FALSE, facet_labels = NULL, facet_layout = NULL, facet_ncol = NULL, facet_nrow = NULL, facet_scales = "fixed", facet_space = "fixed", title = NULL, subtitle = NULL, caption = NULL, label_case = NULL )
gg_ribbon_line( data = NULL, ..., stat = "identity", position = "identity", coord = ggplot2::coord_cartesian(clip = "off"), theme = NULL, theme_orientation = NULL, theme_axis_line_rm = NULL, theme_axis_ticks_rm = NULL, theme_panel_grid_rm = NULL, blend = NULL, x = NULL, xmin = NULL, xmax = NULL, xend = NULL, y = NULL, ymin = NULL, ymax = NULL, yend = NULL, z = NULL, col = NULL, facet = NULL, facet2 = NULL, group = NULL, subgroup = NULL, label = NULL, text = NULL, sample = NULL, mapping = NULL, x_breaks = NULL, x_breaks_n = NULL, x_expand = NULL, x_expand_limits = NULL, x_label = NULL, x_labels = NULL, x_position = "bottom", x_sec_axis = ggplot2::waiver(), x_symmetric = NULL, x_transform = NULL, y_breaks = NULL, y_breaks_n = NULL, y_expand = NULL, y_expand_limits = NULL, y_label = NULL, y_labels = NULL, y_position = "left", y_sec_axis = ggplot2::waiver(), y_symmetric = NULL, y_transform = NULL, col_breaks = NULL, col_breaks_n = 5, col_drop = FALSE, col_expand_limits = NULL, col_label = NULL, col_labels = NULL, col_legend_ncol = NULL, col_legend_nrow = NULL, col_legend_rev = FALSE, col_palette = NULL, col_palette_na = NULL, col_rescale = scales::rescale(), col_steps = FALSE, col_transform = NULL, facet_axes = NULL, facet_axis_labels = "margins", facet_drop = FALSE, facet_labels = NULL, facet_layout = NULL, facet_ncol = NULL, facet_nrow = NULL, facet_scales = "fixed", facet_space = "fixed", title = NULL, subtitle = NULL, caption = NULL, label_case = NULL )
data |
A data frame or tibble. |
... |
Other arguments passed to within a |
stat |
A statistical transformation to use on the data. A snakecase character string of a ggproto Stat subclass object minus the Stat prefix (e.g. |
position |
A position adjustment. A snakecase character string of a ggproto Position subclass object minus the Position prefix (e.g. |
coord |
A coordinate system. A |
theme |
A ggplot2 theme (e.g. |
theme_orientation |
The orientation of plot, which affects the theme components that are removed. Either |
theme_axis_line_rm |
|
theme_axis_ticks_rm |
|
theme_panel_grid_rm |
|
blend |
The blending mode per |
x , xmin , xmax , xend , y , ymin , ymax , yend , z , col , facet , facet2 , group , subgroup , label , text , sample
|
An unquoted aesthetic variable. |
mapping |
A set of additional aesthetic mappings in |
x_breaks , y_breaks , col_breaks
|
A |
x_breaks_n , y_breaks_n , col_breaks_n
|
A number of desired breaks for when |
x_expand , y_expand
|
Padding to the limits with the |
x_expand_limits , y_expand_limits , col_expand_limits
|
For a continuous variable, any values that the limits should encompass (e.g. |
x_label , y_label , col_label
|
Label for the axis or legend title. Use |
x_labels , y_labels , col_labels , facet_labels
|
A function that takes the breaks as inputs (e.g. |
x_position , y_position
|
The position of the axis (i.e. |
x_sec_axis , y_sec_axis
|
A secondary axis with |
x_symmetric , y_symmetric
|
|
x_transform , y_transform , col_transform
|
For a continuous scale, a transformation object (e.g. |
col_drop , facet_drop
|
For a discrete variable, FALSE or TRUE of whether to drop unused levels. |
col_legend_ncol , col_legend_nrow
|
The number of columns and rows in a legend guide. |
col_legend_rev |
|
col_palette |
A character vector of hex codes (or names) or a |
col_palette_na |
A hex code (or name) for the colour of |
col_rescale |
For a continuous variable, a |
col_steps |
For a continuous variable, |
facet_axes |
Whether to add interior axes and ticks with |
facet_axis_labels |
Whether to add interior axis labels with |
facet_layout |
Whether the layout is to be |
facet_ncol , facet_nrow
|
The number of columns and rows of facet panels. Only applies to a facet layout of |
facet_scales |
Whether facet scales should be |
facet_space |
When the facet scales are not |
title |
Title string. |
subtitle |
Subtitle string. |
caption |
Caption title string. |
label_case |
A function to format the label of unlabelled variables. Defaults to |
A ggplot object.
library(ggplot2) library(dplyr) set_blanket() data.frame(year = 1875:1972, level = as.vector(LakeHuron)) |> mutate(level_min = level - 1, level_max = level + 1) |> gg_ribbon_line( x = year, y = level, ymin = level_min, ymax = level_max, blend = "multiply", se = TRUE, )
library(ggplot2) library(dplyr) set_blanket() data.frame(year = 1875:1972, level = as.vector(LakeHuron)) |> mutate(level_min = level - 1, level_max = level + 1) |> gg_ribbon_line( x = year, y = level, ymin = level_min, ymax = level_max, blend = "multiply", se = TRUE, )
Create a rug ggplot with a wrapper around ggplot2::ggplot()
+ geom_rug().
gg_rug( data = NULL, ..., stat = "identity", position = "identity", coord = ggplot2::coord_cartesian(clip = "off"), theme = NULL, theme_orientation = NULL, theme_axis_line_rm = NULL, theme_axis_ticks_rm = NULL, theme_panel_grid_rm = NULL, blend = NULL, x = NULL, xmin = NULL, xmax = NULL, xend = NULL, y = NULL, ymin = NULL, ymax = NULL, yend = NULL, z = NULL, col = NULL, facet = NULL, facet2 = NULL, group = NULL, subgroup = NULL, label = NULL, text = NULL, sample = NULL, mapping = NULL, x_breaks = NULL, x_breaks_n = NULL, x_expand = NULL, x_expand_limits = NULL, x_label = NULL, x_labels = NULL, x_position = "bottom", x_sec_axis = ggplot2::waiver(), x_symmetric = NULL, x_transform = NULL, y_breaks = NULL, y_breaks_n = NULL, y_expand = NULL, y_expand_limits = NULL, y_label = NULL, y_labels = NULL, y_position = "left", y_sec_axis = ggplot2::waiver(), y_symmetric = NULL, y_transform = NULL, col_breaks = NULL, col_breaks_n = 5, col_drop = FALSE, col_expand_limits = NULL, col_label = NULL, col_labels = NULL, col_legend_ncol = NULL, col_legend_nrow = NULL, col_legend_rev = FALSE, col_palette = NULL, col_palette_na = NULL, col_rescale = scales::rescale(), col_steps = FALSE, col_transform = NULL, facet_axes = NULL, facet_axis_labels = "margins", facet_drop = FALSE, facet_labels = NULL, facet_layout = NULL, facet_ncol = NULL, facet_nrow = NULL, facet_scales = "fixed", facet_space = "fixed", title = NULL, subtitle = NULL, caption = NULL, label_case = NULL )
gg_rug( data = NULL, ..., stat = "identity", position = "identity", coord = ggplot2::coord_cartesian(clip = "off"), theme = NULL, theme_orientation = NULL, theme_axis_line_rm = NULL, theme_axis_ticks_rm = NULL, theme_panel_grid_rm = NULL, blend = NULL, x = NULL, xmin = NULL, xmax = NULL, xend = NULL, y = NULL, ymin = NULL, ymax = NULL, yend = NULL, z = NULL, col = NULL, facet = NULL, facet2 = NULL, group = NULL, subgroup = NULL, label = NULL, text = NULL, sample = NULL, mapping = NULL, x_breaks = NULL, x_breaks_n = NULL, x_expand = NULL, x_expand_limits = NULL, x_label = NULL, x_labels = NULL, x_position = "bottom", x_sec_axis = ggplot2::waiver(), x_symmetric = NULL, x_transform = NULL, y_breaks = NULL, y_breaks_n = NULL, y_expand = NULL, y_expand_limits = NULL, y_label = NULL, y_labels = NULL, y_position = "left", y_sec_axis = ggplot2::waiver(), y_symmetric = NULL, y_transform = NULL, col_breaks = NULL, col_breaks_n = 5, col_drop = FALSE, col_expand_limits = NULL, col_label = NULL, col_labels = NULL, col_legend_ncol = NULL, col_legend_nrow = NULL, col_legend_rev = FALSE, col_palette = NULL, col_palette_na = NULL, col_rescale = scales::rescale(), col_steps = FALSE, col_transform = NULL, facet_axes = NULL, facet_axis_labels = "margins", facet_drop = FALSE, facet_labels = NULL, facet_layout = NULL, facet_ncol = NULL, facet_nrow = NULL, facet_scales = "fixed", facet_space = "fixed", title = NULL, subtitle = NULL, caption = NULL, label_case = NULL )
data |
A data frame or tibble. |
... |
Other arguments passed to within a |
stat |
A statistical transformation to use on the data. A snakecase character string of a ggproto Stat subclass object minus the Stat prefix (e.g. |
position |
A position adjustment. A snakecase character string of a ggproto Position subclass object minus the Position prefix (e.g. |
coord |
A coordinate system. A |
theme |
A ggplot2 theme (e.g. |
theme_orientation |
The orientation of plot, which affects the theme components that are removed. Either |
theme_axis_line_rm |
|
theme_axis_ticks_rm |
|
theme_panel_grid_rm |
|
blend |
The blending mode per |
x , xmin , xmax , xend , y , ymin , ymax , yend , z , col , facet , facet2 , group , subgroup , label , text , sample
|
An unquoted aesthetic variable. |
mapping |
A set of additional aesthetic mappings in |
x_breaks , y_breaks , col_breaks
|
A |
x_breaks_n , y_breaks_n , col_breaks_n
|
A number of desired breaks for when |
x_expand , y_expand
|
Padding to the limits with the |
x_expand_limits , y_expand_limits , col_expand_limits
|
For a continuous variable, any values that the limits should encompass (e.g. |
x_label , y_label , col_label
|
Label for the axis or legend title. Use |
x_labels , y_labels , col_labels , facet_labels
|
A function that takes the breaks as inputs (e.g. |
x_position , y_position
|
The position of the axis (i.e. |
x_sec_axis , y_sec_axis
|
A secondary axis with |
x_symmetric , y_symmetric
|
|
x_transform , y_transform , col_transform
|
For a continuous scale, a transformation object (e.g. |
col_drop , facet_drop
|
For a discrete variable, FALSE or TRUE of whether to drop unused levels. |
col_legend_ncol , col_legend_nrow
|
The number of columns and rows in a legend guide. |
col_legend_rev |
|
col_palette |
A character vector of hex codes (or names) or a |
col_palette_na |
A hex code (or name) for the colour of |
col_rescale |
For a continuous variable, a |
col_steps |
For a continuous variable, |
facet_axes |
Whether to add interior axes and ticks with |
facet_axis_labels |
Whether to add interior axis labels with |
facet_layout |
Whether the layout is to be |
facet_ncol , facet_nrow
|
The number of columns and rows of facet panels. Only applies to a facet layout of |
facet_scales |
Whether facet scales should be |
facet_space |
When the facet scales are not |
title |
Title string. |
subtitle |
Subtitle string. |
caption |
Caption title string. |
label_case |
A function to format the label of unlabelled variables. Defaults to |
A ggplot object.
library(ggplot2) library(dplyr) library(palmerpenguins) set_blanket() penguins |> gg_rug( x = flipper_length_mm, y = body_mass_g, col = species, )
library(ggplot2) library(dplyr) library(palmerpenguins) set_blanket() penguins |> gg_rug( x = flipper_length_mm, y = body_mass_g, col = species, )
Create a segment ggplot with a wrapper around ggplot2::ggplot()
+ geom_segment().
gg_segment( data = NULL, ..., stat = "identity", position = "identity", coord = ggplot2::coord_cartesian(clip = "off"), theme = NULL, theme_orientation = NULL, theme_axis_line_rm = NULL, theme_axis_ticks_rm = NULL, theme_panel_grid_rm = NULL, blend = NULL, x = NULL, xmin = NULL, xmax = NULL, xend = NULL, y = NULL, ymin = NULL, ymax = NULL, yend = NULL, z = NULL, col = NULL, facet = NULL, facet2 = NULL, group = NULL, subgroup = NULL, label = NULL, text = NULL, sample = NULL, mapping = NULL, x_breaks = NULL, x_breaks_n = NULL, x_expand = NULL, x_expand_limits = NULL, x_label = NULL, x_labels = NULL, x_position = "bottom", x_sec_axis = ggplot2::waiver(), x_symmetric = NULL, x_transform = NULL, y_breaks = NULL, y_breaks_n = NULL, y_expand = NULL, y_expand_limits = NULL, y_label = NULL, y_labels = NULL, y_position = "left", y_sec_axis = ggplot2::waiver(), y_symmetric = NULL, y_transform = NULL, col_breaks = NULL, col_breaks_n = 5, col_drop = FALSE, col_expand_limits = NULL, col_label = NULL, col_labels = NULL, col_legend_ncol = NULL, col_legend_nrow = NULL, col_legend_rev = FALSE, col_palette = NULL, col_palette_na = NULL, col_rescale = scales::rescale(), col_steps = FALSE, col_transform = NULL, facet_axes = NULL, facet_axis_labels = "margins", facet_drop = FALSE, facet_labels = NULL, facet_layout = NULL, facet_ncol = NULL, facet_nrow = NULL, facet_scales = "fixed", facet_space = "fixed", title = NULL, subtitle = NULL, caption = NULL, label_case = NULL )
gg_segment( data = NULL, ..., stat = "identity", position = "identity", coord = ggplot2::coord_cartesian(clip = "off"), theme = NULL, theme_orientation = NULL, theme_axis_line_rm = NULL, theme_axis_ticks_rm = NULL, theme_panel_grid_rm = NULL, blend = NULL, x = NULL, xmin = NULL, xmax = NULL, xend = NULL, y = NULL, ymin = NULL, ymax = NULL, yend = NULL, z = NULL, col = NULL, facet = NULL, facet2 = NULL, group = NULL, subgroup = NULL, label = NULL, text = NULL, sample = NULL, mapping = NULL, x_breaks = NULL, x_breaks_n = NULL, x_expand = NULL, x_expand_limits = NULL, x_label = NULL, x_labels = NULL, x_position = "bottom", x_sec_axis = ggplot2::waiver(), x_symmetric = NULL, x_transform = NULL, y_breaks = NULL, y_breaks_n = NULL, y_expand = NULL, y_expand_limits = NULL, y_label = NULL, y_labels = NULL, y_position = "left", y_sec_axis = ggplot2::waiver(), y_symmetric = NULL, y_transform = NULL, col_breaks = NULL, col_breaks_n = 5, col_drop = FALSE, col_expand_limits = NULL, col_label = NULL, col_labels = NULL, col_legend_ncol = NULL, col_legend_nrow = NULL, col_legend_rev = FALSE, col_palette = NULL, col_palette_na = NULL, col_rescale = scales::rescale(), col_steps = FALSE, col_transform = NULL, facet_axes = NULL, facet_axis_labels = "margins", facet_drop = FALSE, facet_labels = NULL, facet_layout = NULL, facet_ncol = NULL, facet_nrow = NULL, facet_scales = "fixed", facet_space = "fixed", title = NULL, subtitle = NULL, caption = NULL, label_case = NULL )
data |
A data frame or tibble. |
... |
Other arguments passed to within a |
stat |
A statistical transformation to use on the data. A snakecase character string of a ggproto Stat subclass object minus the Stat prefix (e.g. |
position |
A position adjustment. A snakecase character string of a ggproto Position subclass object minus the Position prefix (e.g. |
coord |
A coordinate system. A |
theme |
A ggplot2 theme (e.g. |
theme_orientation |
The orientation of plot, which affects the theme components that are removed. Either |
theme_axis_line_rm |
|
theme_axis_ticks_rm |
|
theme_panel_grid_rm |
|
blend |
The blending mode per |
x , xmin , xmax , xend , y , ymin , ymax , yend , z , col , facet , facet2 , group , subgroup , label , text , sample
|
An unquoted aesthetic variable. |
mapping |
A set of additional aesthetic mappings in |
x_breaks , y_breaks , col_breaks
|
A |
x_breaks_n , y_breaks_n , col_breaks_n
|
A number of desired breaks for when |
x_expand , y_expand
|
Padding to the limits with the |
x_expand_limits , y_expand_limits , col_expand_limits
|
For a continuous variable, any values that the limits should encompass (e.g. |
x_label , y_label , col_label
|
Label for the axis or legend title. Use |
x_labels , y_labels , col_labels , facet_labels
|
A function that takes the breaks as inputs (e.g. |
x_position , y_position
|
The position of the axis (i.e. |
x_sec_axis , y_sec_axis
|
A secondary axis with |
x_symmetric , y_symmetric
|
|
x_transform , y_transform , col_transform
|
For a continuous scale, a transformation object (e.g. |
col_drop , facet_drop
|
For a discrete variable, FALSE or TRUE of whether to drop unused levels. |
col_legend_ncol , col_legend_nrow
|
The number of columns and rows in a legend guide. |
col_legend_rev |
|
col_palette |
A character vector of hex codes (or names) or a |
col_palette_na |
A hex code (or name) for the colour of |
col_rescale |
For a continuous variable, a |
col_steps |
For a continuous variable, |
facet_axes |
Whether to add interior axes and ticks with |
facet_axis_labels |
Whether to add interior axis labels with |
facet_layout |
Whether the layout is to be |
facet_ncol , facet_nrow
|
The number of columns and rows of facet panels. Only applies to a facet layout of |
facet_scales |
Whether facet scales should be |
facet_space |
When the facet scales are not |
title |
Title string. |
subtitle |
Subtitle string. |
caption |
Caption title string. |
label_case |
A function to format the label of unlabelled variables. Defaults to |
A ggplot object.
library(ggplot2) library(dplyr) library(palmerpenguins) set_blanket() data.frame(x1 = 2.62, x2 = 3.57, y1 = 21.0, y2 = 15.0) |> gg_segment( x = x1, xend = x2, y = y1, yend = y2, )
library(ggplot2) library(dplyr) library(palmerpenguins) set_blanket() data.frame(x1 = 2.62, x2 = 3.57, y1 = 21.0, y2 = 15.0) |> gg_segment( x = x1, xend = x2, y = y1, yend = y2, )
Create a blank ggplot with a wrapper around ggplot2::ggplot()
+ geom_sf().
gg_sf( data = NULL, ..., stat = "sf", position = "identity", coord = ggplot2::coord_sf(clip = "off"), theme = NULL, theme_orientation = NULL, theme_axis_line_rm = NULL, theme_axis_ticks_rm = NULL, theme_panel_grid_rm = NULL, blend = NULL, x = NULL, xmin = NULL, xmax = NULL, xend = NULL, y = NULL, ymin = NULL, ymax = NULL, yend = NULL, z = NULL, col = NULL, facet = NULL, facet2 = NULL, group = NULL, subgroup = NULL, label = NULL, text = NULL, sample = NULL, mapping = NULL, x_breaks = NULL, x_breaks_n = NULL, x_expand = NULL, x_expand_limits = NULL, x_label = NULL, x_labels = NULL, x_position = "bottom", x_sec_axis = ggplot2::waiver(), x_symmetric = NULL, x_transform = NULL, y_breaks = NULL, y_breaks_n = NULL, y_expand = NULL, y_expand_limits = NULL, y_label = NULL, y_labels = NULL, y_position = "left", y_sec_axis = ggplot2::waiver(), y_symmetric = NULL, y_transform = NULL, col_breaks = NULL, col_breaks_n = 5, col_drop = FALSE, col_expand_limits = NULL, col_label = NULL, col_labels = NULL, col_legend_ncol = NULL, col_legend_nrow = NULL, col_legend_rev = FALSE, col_palette = NULL, col_palette_na = NULL, col_rescale = scales::rescale(), col_steps = FALSE, col_transform = NULL, facet_axes = NULL, facet_axis_labels = "margins", facet_drop = FALSE, facet_labels = NULL, facet_layout = NULL, facet_ncol = NULL, facet_nrow = NULL, facet_scales = "fixed", facet_space = "fixed", title = NULL, subtitle = NULL, caption = NULL, label_case = NULL )
gg_sf( data = NULL, ..., stat = "sf", position = "identity", coord = ggplot2::coord_sf(clip = "off"), theme = NULL, theme_orientation = NULL, theme_axis_line_rm = NULL, theme_axis_ticks_rm = NULL, theme_panel_grid_rm = NULL, blend = NULL, x = NULL, xmin = NULL, xmax = NULL, xend = NULL, y = NULL, ymin = NULL, ymax = NULL, yend = NULL, z = NULL, col = NULL, facet = NULL, facet2 = NULL, group = NULL, subgroup = NULL, label = NULL, text = NULL, sample = NULL, mapping = NULL, x_breaks = NULL, x_breaks_n = NULL, x_expand = NULL, x_expand_limits = NULL, x_label = NULL, x_labels = NULL, x_position = "bottom", x_sec_axis = ggplot2::waiver(), x_symmetric = NULL, x_transform = NULL, y_breaks = NULL, y_breaks_n = NULL, y_expand = NULL, y_expand_limits = NULL, y_label = NULL, y_labels = NULL, y_position = "left", y_sec_axis = ggplot2::waiver(), y_symmetric = NULL, y_transform = NULL, col_breaks = NULL, col_breaks_n = 5, col_drop = FALSE, col_expand_limits = NULL, col_label = NULL, col_labels = NULL, col_legend_ncol = NULL, col_legend_nrow = NULL, col_legend_rev = FALSE, col_palette = NULL, col_palette_na = NULL, col_rescale = scales::rescale(), col_steps = FALSE, col_transform = NULL, facet_axes = NULL, facet_axis_labels = "margins", facet_drop = FALSE, facet_labels = NULL, facet_layout = NULL, facet_ncol = NULL, facet_nrow = NULL, facet_scales = "fixed", facet_space = "fixed", title = NULL, subtitle = NULL, caption = NULL, label_case = NULL )
data |
A data frame or tibble. |
... |
Other arguments passed to within a |
stat |
A statistical transformation to use on the data. A snakecase character string of a ggproto Stat subclass object minus the Stat prefix (e.g. |
position |
A position adjustment. A snakecase character string of a ggproto Position subclass object minus the Position prefix (e.g. |
coord |
A coordinate system. A |
theme |
A ggplot2 theme (e.g. |
theme_orientation |
The orientation of plot, which affects the theme components that are removed. Either |
theme_axis_line_rm |
|
theme_axis_ticks_rm |
|
theme_panel_grid_rm |
|
blend |
The blending mode per |
x , xmin , xmax , xend , y , ymin , ymax , yend , z , col , facet , facet2 , group , subgroup , label , text , sample
|
An unquoted aesthetic variable. |
mapping |
A set of additional aesthetic mappings in |
x_breaks , y_breaks , col_breaks
|
A |
x_breaks_n , y_breaks_n , col_breaks_n
|
A number of desired breaks for when |
x_expand , y_expand
|
Padding to the limits with the |
x_expand_limits , y_expand_limits , col_expand_limits
|
For a continuous variable, any values that the limits should encompass (e.g. |
x_label , y_label , col_label
|
Label for the axis or legend title. Use |
x_labels , y_labels , col_labels , facet_labels
|
A function that takes the breaks as inputs (e.g. |
x_position , y_position
|
The position of the axis (i.e. |
x_sec_axis , y_sec_axis
|
A secondary axis with |
x_symmetric , y_symmetric
|
|
x_transform , y_transform , col_transform
|
For a continuous scale, a transformation object (e.g. |
col_drop , facet_drop
|
For a discrete variable, FALSE or TRUE of whether to drop unused levels. |
col_legend_ncol , col_legend_nrow
|
The number of columns and rows in a legend guide. |
col_legend_rev |
|
col_palette |
A character vector of hex codes (or names) or a |
col_palette_na |
A hex code (or name) for the colour of |
col_rescale |
For a continuous variable, a |
col_steps |
For a continuous variable, |
facet_axes |
Whether to add interior axes and ticks with |
facet_axis_labels |
Whether to add interior axis labels with |
facet_layout |
Whether the layout is to be |
facet_ncol , facet_nrow
|
The number of columns and rows of facet panels. Only applies to a facet layout of |
facet_scales |
Whether facet scales should be |
facet_space |
When the facet scales are not |
title |
Title string. |
subtitle |
Subtitle string. |
caption |
Caption title string. |
label_case |
A function to format the label of unlabelled variables. Defaults to |
A ggplot object.
library(ggplot2) library(dplyr) set_blanket() if (requireNamespace("sf", quietly = TRUE)) { sf::st_read(system.file("shape/nc.shp", package = "sf")) |> gg_sf( col = AREA, ) }
library(ggplot2) library(dplyr) set_blanket() if (requireNamespace("sf", quietly = TRUE)) { sf::st_read(system.file("shape/nc.shp", package = "sf")) |> gg_sf( col = AREA, ) }
Create a smooth ggplot with a wrapper around ggplot2::ggplot()
+ geom_smooth().
gg_smooth( data = NULL, ..., stat = "smooth", position = "identity", coord = ggplot2::coord_cartesian(clip = "off"), theme = NULL, theme_orientation = NULL, theme_axis_line_rm = NULL, theme_axis_ticks_rm = NULL, theme_panel_grid_rm = NULL, blend = NULL, x = NULL, xmin = NULL, xmax = NULL, xend = NULL, y = NULL, ymin = NULL, ymax = NULL, yend = NULL, z = NULL, col = NULL, facet = NULL, facet2 = NULL, group = NULL, subgroup = NULL, label = NULL, text = NULL, sample = NULL, mapping = NULL, x_breaks = NULL, x_breaks_n = NULL, x_expand = NULL, x_expand_limits = NULL, x_label = NULL, x_labels = NULL, x_position = "bottom", x_sec_axis = ggplot2::waiver(), x_symmetric = NULL, x_transform = NULL, y_breaks = NULL, y_breaks_n = NULL, y_expand = NULL, y_expand_limits = NULL, y_label = NULL, y_labels = NULL, y_position = "left", y_sec_axis = ggplot2::waiver(), y_symmetric = NULL, y_transform = NULL, col_breaks = NULL, col_breaks_n = 5, col_drop = FALSE, col_expand_limits = NULL, col_label = NULL, col_labels = NULL, col_legend_ncol = NULL, col_legend_nrow = NULL, col_legend_rev = FALSE, col_palette = NULL, col_palette_na = NULL, col_rescale = scales::rescale(), col_steps = FALSE, col_transform = NULL, facet_axes = NULL, facet_axis_labels = "margins", facet_drop = FALSE, facet_labels = NULL, facet_layout = NULL, facet_ncol = NULL, facet_nrow = NULL, facet_scales = "fixed", facet_space = "fixed", title = NULL, subtitle = NULL, caption = NULL, label_case = NULL )
gg_smooth( data = NULL, ..., stat = "smooth", position = "identity", coord = ggplot2::coord_cartesian(clip = "off"), theme = NULL, theme_orientation = NULL, theme_axis_line_rm = NULL, theme_axis_ticks_rm = NULL, theme_panel_grid_rm = NULL, blend = NULL, x = NULL, xmin = NULL, xmax = NULL, xend = NULL, y = NULL, ymin = NULL, ymax = NULL, yend = NULL, z = NULL, col = NULL, facet = NULL, facet2 = NULL, group = NULL, subgroup = NULL, label = NULL, text = NULL, sample = NULL, mapping = NULL, x_breaks = NULL, x_breaks_n = NULL, x_expand = NULL, x_expand_limits = NULL, x_label = NULL, x_labels = NULL, x_position = "bottom", x_sec_axis = ggplot2::waiver(), x_symmetric = NULL, x_transform = NULL, y_breaks = NULL, y_breaks_n = NULL, y_expand = NULL, y_expand_limits = NULL, y_label = NULL, y_labels = NULL, y_position = "left", y_sec_axis = ggplot2::waiver(), y_symmetric = NULL, y_transform = NULL, col_breaks = NULL, col_breaks_n = 5, col_drop = FALSE, col_expand_limits = NULL, col_label = NULL, col_labels = NULL, col_legend_ncol = NULL, col_legend_nrow = NULL, col_legend_rev = FALSE, col_palette = NULL, col_palette_na = NULL, col_rescale = scales::rescale(), col_steps = FALSE, col_transform = NULL, facet_axes = NULL, facet_axis_labels = "margins", facet_drop = FALSE, facet_labels = NULL, facet_layout = NULL, facet_ncol = NULL, facet_nrow = NULL, facet_scales = "fixed", facet_space = "fixed", title = NULL, subtitle = NULL, caption = NULL, label_case = NULL )
data |
A data frame or tibble. |
... |
Other arguments passed to within a |
stat |
A statistical transformation to use on the data. A snakecase character string of a ggproto Stat subclass object minus the Stat prefix (e.g. |
position |
A position adjustment. A snakecase character string of a ggproto Position subclass object minus the Position prefix (e.g. |
coord |
A coordinate system. A |
theme |
A ggplot2 theme (e.g. |
theme_orientation |
The orientation of plot, which affects the theme components that are removed. Either |
theme_axis_line_rm |
|
theme_axis_ticks_rm |
|
theme_panel_grid_rm |
|
blend |
The blending mode per |
x , xmin , xmax , xend , y , ymin , ymax , yend , z , col , facet , facet2 , group , subgroup , label , text , sample
|
An unquoted aesthetic variable. |
mapping |
A set of additional aesthetic mappings in |
x_breaks , y_breaks , col_breaks
|
A |
x_breaks_n , y_breaks_n , col_breaks_n
|
A number of desired breaks for when |
x_expand , y_expand
|
Padding to the limits with the |
x_expand_limits , y_expand_limits , col_expand_limits
|
For a continuous variable, any values that the limits should encompass (e.g. |
x_label , y_label , col_label
|
Label for the axis or legend title. Use |
x_labels , y_labels , col_labels , facet_labels
|
A function that takes the breaks as inputs (e.g. |
x_position , y_position
|
The position of the axis (i.e. |
x_sec_axis , y_sec_axis
|
A secondary axis with |
x_symmetric , y_symmetric
|
|
x_transform , y_transform , col_transform
|
For a continuous scale, a transformation object (e.g. |
col_drop , facet_drop
|
For a discrete variable, FALSE or TRUE of whether to drop unused levels. |
col_legend_ncol , col_legend_nrow
|
The number of columns and rows in a legend guide. |
col_legend_rev |
|
col_palette |
A character vector of hex codes (or names) or a |
col_palette_na |
A hex code (or name) for the colour of |
col_rescale |
For a continuous variable, a |
col_steps |
For a continuous variable, |
facet_axes |
Whether to add interior axes and ticks with |
facet_axis_labels |
Whether to add interior axis labels with |
facet_layout |
Whether the layout is to be |
facet_ncol , facet_nrow
|
The number of columns and rows of facet panels. Only applies to a facet layout of |
facet_scales |
Whether facet scales should be |
facet_space |
When the facet scales are not |
title |
Title string. |
subtitle |
Subtitle string. |
caption |
Caption title string. |
label_case |
A function to format the label of unlabelled variables. Defaults to |
A ggplot object.
library(ggplot2) library(dplyr) library(palmerpenguins) set_blanket() penguins |> gg_smooth( x = flipper_length_mm, y = body_mass_g, col = species, se = TRUE, blend = "multiply", )
library(ggplot2) library(dplyr) library(palmerpenguins) set_blanket() penguins |> gg_smooth( x = flipper_length_mm, y = body_mass_g, col = species, se = TRUE, blend = "multiply", )
Create a step plot with a wrapper around ggplot2::ggplot()
+ geom_step().
gg_step( data = NULL, ..., stat = "identity", position = "identity", coord = ggplot2::coord_cartesian(clip = "off"), theme = NULL, theme_orientation = NULL, theme_axis_line_rm = NULL, theme_axis_ticks_rm = NULL, theme_panel_grid_rm = NULL, blend = NULL, x = NULL, xmin = NULL, xmax = NULL, xend = NULL, y = NULL, ymin = NULL, ymax = NULL, yend = NULL, z = NULL, col = NULL, facet = NULL, facet2 = NULL, group = NULL, subgroup = NULL, label = NULL, text = NULL, sample = NULL, mapping = NULL, x_breaks = NULL, x_breaks_n = NULL, x_expand = NULL, x_expand_limits = NULL, x_label = NULL, x_labels = NULL, x_position = "bottom", x_sec_axis = ggplot2::waiver(), x_symmetric = NULL, x_transform = NULL, y_breaks = NULL, y_breaks_n = NULL, y_expand = NULL, y_expand_limits = NULL, y_label = NULL, y_labels = NULL, y_position = "left", y_sec_axis = ggplot2::waiver(), y_symmetric = NULL, y_transform = NULL, col_breaks = NULL, col_breaks_n = 5, col_drop = FALSE, col_expand_limits = NULL, col_label = NULL, col_labels = NULL, col_legend_ncol = NULL, col_legend_nrow = NULL, col_legend_rev = FALSE, col_palette = NULL, col_palette_na = NULL, col_rescale = scales::rescale(), col_steps = FALSE, col_transform = NULL, facet_axes = NULL, facet_axis_labels = "margins", facet_drop = FALSE, facet_labels = NULL, facet_layout = NULL, facet_ncol = NULL, facet_nrow = NULL, facet_scales = "fixed", facet_space = "fixed", title = NULL, subtitle = NULL, caption = NULL, label_case = NULL )
gg_step( data = NULL, ..., stat = "identity", position = "identity", coord = ggplot2::coord_cartesian(clip = "off"), theme = NULL, theme_orientation = NULL, theme_axis_line_rm = NULL, theme_axis_ticks_rm = NULL, theme_panel_grid_rm = NULL, blend = NULL, x = NULL, xmin = NULL, xmax = NULL, xend = NULL, y = NULL, ymin = NULL, ymax = NULL, yend = NULL, z = NULL, col = NULL, facet = NULL, facet2 = NULL, group = NULL, subgroup = NULL, label = NULL, text = NULL, sample = NULL, mapping = NULL, x_breaks = NULL, x_breaks_n = NULL, x_expand = NULL, x_expand_limits = NULL, x_label = NULL, x_labels = NULL, x_position = "bottom", x_sec_axis = ggplot2::waiver(), x_symmetric = NULL, x_transform = NULL, y_breaks = NULL, y_breaks_n = NULL, y_expand = NULL, y_expand_limits = NULL, y_label = NULL, y_labels = NULL, y_position = "left", y_sec_axis = ggplot2::waiver(), y_symmetric = NULL, y_transform = NULL, col_breaks = NULL, col_breaks_n = 5, col_drop = FALSE, col_expand_limits = NULL, col_label = NULL, col_labels = NULL, col_legend_ncol = NULL, col_legend_nrow = NULL, col_legend_rev = FALSE, col_palette = NULL, col_palette_na = NULL, col_rescale = scales::rescale(), col_steps = FALSE, col_transform = NULL, facet_axes = NULL, facet_axis_labels = "margins", facet_drop = FALSE, facet_labels = NULL, facet_layout = NULL, facet_ncol = NULL, facet_nrow = NULL, facet_scales = "fixed", facet_space = "fixed", title = NULL, subtitle = NULL, caption = NULL, label_case = NULL )
data |
A data frame or tibble. |
... |
Other arguments passed to within a |
stat |
A statistical transformation to use on the data. A snakecase character string of a ggproto Stat subclass object minus the Stat prefix (e.g. |
position |
A position adjustment. A snakecase character string of a ggproto Position subclass object minus the Position prefix (e.g. |
coord |
A coordinate system. A |
theme |
A ggplot2 theme (e.g. |
theme_orientation |
The orientation of plot, which affects the theme components that are removed. Either |
theme_axis_line_rm |
|
theme_axis_ticks_rm |
|
theme_panel_grid_rm |
|
blend |
The blending mode per |
x , xmin , xmax , xend , y , ymin , ymax , yend , z , col , facet , facet2 , group , subgroup , label , text , sample
|
An unquoted aesthetic variable. |
mapping |
A set of additional aesthetic mappings in |
x_breaks , y_breaks , col_breaks
|
A |
x_breaks_n , y_breaks_n , col_breaks_n
|
A number of desired breaks for when |
x_expand , y_expand
|
Padding to the limits with the |
x_expand_limits , y_expand_limits , col_expand_limits
|
For a continuous variable, any values that the limits should encompass (e.g. |
x_label , y_label , col_label
|
Label for the axis or legend title. Use |
x_labels , y_labels , col_labels , facet_labels
|
A function that takes the breaks as inputs (e.g. |
x_position , y_position
|
The position of the axis (i.e. |
x_sec_axis , y_sec_axis
|
A secondary axis with |
x_symmetric , y_symmetric
|
|
x_transform , y_transform , col_transform
|
For a continuous scale, a transformation object (e.g. |
col_drop , facet_drop
|
For a discrete variable, FALSE or TRUE of whether to drop unused levels. |
col_legend_ncol , col_legend_nrow
|
The number of columns and rows in a legend guide. |
col_legend_rev |
|
col_palette |
A character vector of hex codes (or names) or a |
col_palette_na |
A hex code (or name) for the colour of |
col_rescale |
For a continuous variable, a |
col_steps |
For a continuous variable, |
facet_axes |
Whether to add interior axes and ticks with |
facet_axis_labels |
Whether to add interior axis labels with |
facet_layout |
Whether the layout is to be |
facet_ncol , facet_nrow
|
The number of columns and rows of facet panels. Only applies to a facet layout of |
facet_scales |
Whether facet scales should be |
facet_space |
When the facet scales are not |
title |
Title string. |
subtitle |
Subtitle string. |
caption |
Caption title string. |
label_case |
A function to format the label of unlabelled variables. Defaults to |
A ggplot object.
library(ggplot2) library(dplyr) set_blanket() economics |> filter(date > lubridate::ymd("2010-01-01")) |> gg_step( x = date, y = unemploy, y_expand_limits = 0, y_label = "Unemployment", )
library(ggplot2) library(dplyr) set_blanket() economics |> filter(date > lubridate::ymd("2010-01-01")) |> gg_step( x = date, y = unemploy, y_expand_limits = 0, y_label = "Unemployment", )
Create a text plot with a wrapper around ggplot2::ggplot()
+ geom_text().
gg_text( data = NULL, ..., stat = "identity", position = "identity", coord = ggplot2::coord_cartesian(clip = "off"), theme = NULL, theme_orientation = NULL, theme_axis_line_rm = NULL, theme_axis_ticks_rm = NULL, theme_panel_grid_rm = NULL, blend = NULL, x = NULL, xmin = NULL, xmax = NULL, xend = NULL, y = NULL, ymin = NULL, ymax = NULL, yend = NULL, z = NULL, col = NULL, facet = NULL, facet2 = NULL, group = NULL, subgroup = NULL, label = NULL, text = NULL, sample = NULL, mapping = NULL, x_breaks = NULL, x_breaks_n = NULL, x_expand = NULL, x_expand_limits = NULL, x_label = NULL, x_labels = NULL, x_position = "bottom", x_sec_axis = ggplot2::waiver(), x_symmetric = NULL, x_transform = NULL, y_breaks = NULL, y_breaks_n = NULL, y_expand = NULL, y_expand_limits = NULL, y_label = NULL, y_labels = NULL, y_position = "left", y_sec_axis = ggplot2::waiver(), y_symmetric = NULL, y_transform = NULL, col_breaks = NULL, col_breaks_n = 5, col_drop = FALSE, col_expand_limits = NULL, col_label = NULL, col_labels = NULL, col_legend_ncol = NULL, col_legend_nrow = NULL, col_legend_rev = FALSE, col_palette = NULL, col_palette_na = NULL, col_rescale = scales::rescale(), col_steps = FALSE, col_transform = NULL, facet_axes = NULL, facet_axis_labels = "margins", facet_drop = FALSE, facet_labels = NULL, facet_layout = NULL, facet_ncol = NULL, facet_nrow = NULL, facet_scales = "fixed", facet_space = "fixed", title = NULL, subtitle = NULL, caption = NULL, label_case = NULL )
gg_text( data = NULL, ..., stat = "identity", position = "identity", coord = ggplot2::coord_cartesian(clip = "off"), theme = NULL, theme_orientation = NULL, theme_axis_line_rm = NULL, theme_axis_ticks_rm = NULL, theme_panel_grid_rm = NULL, blend = NULL, x = NULL, xmin = NULL, xmax = NULL, xend = NULL, y = NULL, ymin = NULL, ymax = NULL, yend = NULL, z = NULL, col = NULL, facet = NULL, facet2 = NULL, group = NULL, subgroup = NULL, label = NULL, text = NULL, sample = NULL, mapping = NULL, x_breaks = NULL, x_breaks_n = NULL, x_expand = NULL, x_expand_limits = NULL, x_label = NULL, x_labels = NULL, x_position = "bottom", x_sec_axis = ggplot2::waiver(), x_symmetric = NULL, x_transform = NULL, y_breaks = NULL, y_breaks_n = NULL, y_expand = NULL, y_expand_limits = NULL, y_label = NULL, y_labels = NULL, y_position = "left", y_sec_axis = ggplot2::waiver(), y_symmetric = NULL, y_transform = NULL, col_breaks = NULL, col_breaks_n = 5, col_drop = FALSE, col_expand_limits = NULL, col_label = NULL, col_labels = NULL, col_legend_ncol = NULL, col_legend_nrow = NULL, col_legend_rev = FALSE, col_palette = NULL, col_palette_na = NULL, col_rescale = scales::rescale(), col_steps = FALSE, col_transform = NULL, facet_axes = NULL, facet_axis_labels = "margins", facet_drop = FALSE, facet_labels = NULL, facet_layout = NULL, facet_ncol = NULL, facet_nrow = NULL, facet_scales = "fixed", facet_space = "fixed", title = NULL, subtitle = NULL, caption = NULL, label_case = NULL )
data |
A data frame or tibble. |
... |
Other arguments passed to within a |
stat |
A statistical transformation to use on the data. A snakecase character string of a ggproto Stat subclass object minus the Stat prefix (e.g. |
position |
A position adjustment. A snakecase character string of a ggproto Position subclass object minus the Position prefix (e.g. |
coord |
A coordinate system. A |
theme |
A ggplot2 theme (e.g. |
theme_orientation |
The orientation of plot, which affects the theme components that are removed. Either |
theme_axis_line_rm |
|
theme_axis_ticks_rm |
|
theme_panel_grid_rm |
|
blend |
The blending mode per |
x , xmin , xmax , xend , y , ymin , ymax , yend , z , col , facet , facet2 , group , subgroup , label , text , sample
|
An unquoted aesthetic variable. |
mapping |
A set of additional aesthetic mappings in |
x_breaks , y_breaks , col_breaks
|
A |
x_breaks_n , y_breaks_n , col_breaks_n
|
A number of desired breaks for when |
x_expand , y_expand
|
Padding to the limits with the |
x_expand_limits , y_expand_limits , col_expand_limits
|
For a continuous variable, any values that the limits should encompass (e.g. |
x_label , y_label , col_label
|
Label for the axis or legend title. Use |
x_labels , y_labels , col_labels , facet_labels
|
A function that takes the breaks as inputs (e.g. |
x_position , y_position
|
The position of the axis (i.e. |
x_sec_axis , y_sec_axis
|
A secondary axis with |
x_symmetric , y_symmetric
|
|
x_transform , y_transform , col_transform
|
For a continuous scale, a transformation object (e.g. |
col_drop , facet_drop
|
For a discrete variable, FALSE or TRUE of whether to drop unused levels. |
col_legend_ncol , col_legend_nrow
|
The number of columns and rows in a legend guide. |
col_legend_rev |
|
col_palette |
A character vector of hex codes (or names) or a |
col_palette_na |
A hex code (or name) for the colour of |
col_rescale |
For a continuous variable, a |
col_steps |
For a continuous variable, |
facet_axes |
Whether to add interior axes and ticks with |
facet_axis_labels |
Whether to add interior axis labels with |
facet_layout |
Whether the layout is to be |
facet_ncol , facet_nrow
|
The number of columns and rows of facet panels. Only applies to a facet layout of |
facet_scales |
Whether facet scales should be |
facet_space |
When the facet scales are not |
title |
Title string. |
subtitle |
Subtitle string. |
caption |
Caption title string. |
label_case |
A function to format the label of unlabelled variables. Defaults to |
A ggplot object.
library(ggplot2) library(dplyr) set_blanket() set_font_defaults() bind_rows( mtcars |> slice_min(order_by = mpg), mtcars |> slice_max(order_by = mpg) ) |> tibble::rownames_to_column("themel") |> gg_text( x = themel, y = mpg, label = themel, y_expand_limits = 0, y_label = "Miles per gallon", col_palette = c(orange, "white", teal), )
library(ggplot2) library(dplyr) set_blanket() set_font_defaults() bind_rows( mtcars |> slice_min(order_by = mpg), mtcars |> slice_max(order_by = mpg) ) |> tibble::rownames_to_column("themel") |> gg_text( x = themel, y = mpg, label = themel, y_expand_limits = 0, y_label = "Miles per gallon", col_palette = c(orange, "white", teal), )
Create a tile plot with a wrapper around ggplot2::ggplot()
+ geom_tile().
gg_tile( data = NULL, ..., stat = "identity", position = "identity", coord = ggplot2::coord_cartesian(clip = "off"), theme = NULL, theme_orientation = NULL, theme_axis_line_rm = NULL, theme_axis_ticks_rm = NULL, theme_panel_grid_rm = NULL, blend = NULL, x = NULL, xmin = NULL, xmax = NULL, xend = NULL, y = NULL, ymin = NULL, ymax = NULL, yend = NULL, z = NULL, col = NULL, facet = NULL, facet2 = NULL, group = NULL, subgroup = NULL, label = NULL, text = NULL, sample = NULL, mapping = NULL, x_breaks = NULL, x_breaks_n = NULL, x_expand = NULL, x_expand_limits = NULL, x_label = NULL, x_labels = NULL, x_position = "bottom", x_sec_axis = ggplot2::waiver(), x_symmetric = NULL, x_transform = NULL, y_breaks = NULL, y_breaks_n = NULL, y_expand = NULL, y_expand_limits = NULL, y_label = NULL, y_labels = NULL, y_position = "left", y_sec_axis = ggplot2::waiver(), y_symmetric = NULL, y_transform = NULL, col_breaks = NULL, col_breaks_n = 5, col_drop = FALSE, col_expand_limits = NULL, col_label = NULL, col_labels = NULL, col_legend_ncol = NULL, col_legend_nrow = NULL, col_legend_rev = FALSE, col_palette = NULL, col_palette_na = NULL, col_rescale = scales::rescale(), col_steps = FALSE, col_transform = NULL, facet_axes = NULL, facet_axis_labels = "margins", facet_drop = FALSE, facet_labels = NULL, facet_layout = NULL, facet_ncol = NULL, facet_nrow = NULL, facet_scales = "fixed", facet_space = "fixed", title = NULL, subtitle = NULL, caption = NULL, label_case = NULL )
gg_tile( data = NULL, ..., stat = "identity", position = "identity", coord = ggplot2::coord_cartesian(clip = "off"), theme = NULL, theme_orientation = NULL, theme_axis_line_rm = NULL, theme_axis_ticks_rm = NULL, theme_panel_grid_rm = NULL, blend = NULL, x = NULL, xmin = NULL, xmax = NULL, xend = NULL, y = NULL, ymin = NULL, ymax = NULL, yend = NULL, z = NULL, col = NULL, facet = NULL, facet2 = NULL, group = NULL, subgroup = NULL, label = NULL, text = NULL, sample = NULL, mapping = NULL, x_breaks = NULL, x_breaks_n = NULL, x_expand = NULL, x_expand_limits = NULL, x_label = NULL, x_labels = NULL, x_position = "bottom", x_sec_axis = ggplot2::waiver(), x_symmetric = NULL, x_transform = NULL, y_breaks = NULL, y_breaks_n = NULL, y_expand = NULL, y_expand_limits = NULL, y_label = NULL, y_labels = NULL, y_position = "left", y_sec_axis = ggplot2::waiver(), y_symmetric = NULL, y_transform = NULL, col_breaks = NULL, col_breaks_n = 5, col_drop = FALSE, col_expand_limits = NULL, col_label = NULL, col_labels = NULL, col_legend_ncol = NULL, col_legend_nrow = NULL, col_legend_rev = FALSE, col_palette = NULL, col_palette_na = NULL, col_rescale = scales::rescale(), col_steps = FALSE, col_transform = NULL, facet_axes = NULL, facet_axis_labels = "margins", facet_drop = FALSE, facet_labels = NULL, facet_layout = NULL, facet_ncol = NULL, facet_nrow = NULL, facet_scales = "fixed", facet_space = "fixed", title = NULL, subtitle = NULL, caption = NULL, label_case = NULL )
data |
A data frame or tibble. |
... |
Other arguments passed to within a |
stat |
A statistical transformation to use on the data. A snakecase character string of a ggproto Stat subclass object minus the Stat prefix (e.g. |
position |
A position adjustment. A snakecase character string of a ggproto Position subclass object minus the Position prefix (e.g. |
coord |
A coordinate system. A |
theme |
A ggplot2 theme (e.g. |
theme_orientation |
The orientation of plot, which affects the theme components that are removed. Either |
theme_axis_line_rm |
|
theme_axis_ticks_rm |
|
theme_panel_grid_rm |
|
blend |
The blending mode per |
x , xmin , xmax , xend , y , ymin , ymax , yend , z , col , facet , facet2 , group , subgroup , label , text , sample
|
An unquoted aesthetic variable. |
mapping |
A set of additional aesthetic mappings in |
x_breaks , y_breaks , col_breaks
|
A |
x_breaks_n , y_breaks_n , col_breaks_n
|
A number of desired breaks for when |
x_expand , y_expand
|
Padding to the limits with the |
x_expand_limits , y_expand_limits , col_expand_limits
|
For a continuous variable, any values that the limits should encompass (e.g. |
x_label , y_label , col_label
|
Label for the axis or legend title. Use |
x_labels , y_labels , col_labels , facet_labels
|
A function that takes the breaks as inputs (e.g. |
x_position , y_position
|
The position of the axis (i.e. |
x_sec_axis , y_sec_axis
|
A secondary axis with |
x_symmetric , y_symmetric
|
|
x_transform , y_transform , col_transform
|
For a continuous scale, a transformation object (e.g. |
col_drop , facet_drop
|
For a discrete variable, FALSE or TRUE of whether to drop unused levels. |
col_legend_ncol , col_legend_nrow
|
The number of columns and rows in a legend guide. |
col_legend_rev |
|
col_palette |
A character vector of hex codes (or names) or a |
col_palette_na |
A hex code (or name) for the colour of |
col_rescale |
For a continuous variable, a |
col_steps |
For a continuous variable, |
facet_axes |
Whether to add interior axes and ticks with |
facet_axis_labels |
Whether to add interior axis labels with |
facet_layout |
Whether the layout is to be |
facet_ncol , facet_nrow
|
The number of columns and rows of facet panels. Only applies to a facet layout of |
facet_scales |
Whether facet scales should be |
facet_space |
When the facet scales are not |
title |
Title string. |
subtitle |
Subtitle string. |
caption |
Caption title string. |
label_case |
A function to format the label of unlabelled variables. Defaults to |
A ggplot object.
library(ggplot2) library(dplyr) library(palmerpenguins) set_blanket() penguins |> group_by(species, sex) |> summarise(across(flipper_length_mm, \(x) mean(x, na.rm = TRUE))) |> gg_tile( x = sex, y = species, col = flipper_length_mm, )
library(ggplot2) library(dplyr) library(palmerpenguins) set_blanket() penguins |> group_by(species, sex) |> summarise(across(flipper_length_mm, \(x) mean(x, na.rm = TRUE))) |> gg_tile( x = sex, y = species, col = flipper_length_mm, )
Create a violin plot with a wrapper around ggplot2::ggplot()
+ geom_violin().
gg_violin( data = NULL, ..., stat = "ydensity", position = "dodge", coord = ggplot2::coord_cartesian(clip = "off"), theme = NULL, theme_orientation = NULL, theme_axis_line_rm = NULL, theme_axis_ticks_rm = NULL, theme_panel_grid_rm = NULL, blend = NULL, x = NULL, xmin = NULL, xmax = NULL, xend = NULL, y = NULL, ymin = NULL, ymax = NULL, yend = NULL, z = NULL, col = NULL, facet = NULL, facet2 = NULL, group = NULL, subgroup = NULL, label = NULL, text = NULL, sample = NULL, mapping = NULL, x_breaks = NULL, x_breaks_n = NULL, x_expand = NULL, x_expand_limits = NULL, x_label = NULL, x_labels = NULL, x_position = "bottom", x_sec_axis = ggplot2::waiver(), x_symmetric = NULL, x_transform = NULL, y_breaks = NULL, y_breaks_n = NULL, y_expand = NULL, y_expand_limits = NULL, y_label = NULL, y_labels = NULL, y_position = "left", y_sec_axis = ggplot2::waiver(), y_symmetric = NULL, y_transform = NULL, col_breaks = NULL, col_breaks_n = 5, col_drop = FALSE, col_expand_limits = NULL, col_label = NULL, col_labels = NULL, col_legend_ncol = NULL, col_legend_nrow = NULL, col_legend_rev = FALSE, col_palette = NULL, col_palette_na = NULL, col_rescale = scales::rescale(), col_steps = FALSE, col_transform = NULL, facet_axes = NULL, facet_axis_labels = "margins", facet_drop = FALSE, facet_labels = NULL, facet_layout = NULL, facet_ncol = NULL, facet_nrow = NULL, facet_scales = "fixed", facet_space = "fixed", title = NULL, subtitle = NULL, caption = NULL, label_case = NULL )
gg_violin( data = NULL, ..., stat = "ydensity", position = "dodge", coord = ggplot2::coord_cartesian(clip = "off"), theme = NULL, theme_orientation = NULL, theme_axis_line_rm = NULL, theme_axis_ticks_rm = NULL, theme_panel_grid_rm = NULL, blend = NULL, x = NULL, xmin = NULL, xmax = NULL, xend = NULL, y = NULL, ymin = NULL, ymax = NULL, yend = NULL, z = NULL, col = NULL, facet = NULL, facet2 = NULL, group = NULL, subgroup = NULL, label = NULL, text = NULL, sample = NULL, mapping = NULL, x_breaks = NULL, x_breaks_n = NULL, x_expand = NULL, x_expand_limits = NULL, x_label = NULL, x_labels = NULL, x_position = "bottom", x_sec_axis = ggplot2::waiver(), x_symmetric = NULL, x_transform = NULL, y_breaks = NULL, y_breaks_n = NULL, y_expand = NULL, y_expand_limits = NULL, y_label = NULL, y_labels = NULL, y_position = "left", y_sec_axis = ggplot2::waiver(), y_symmetric = NULL, y_transform = NULL, col_breaks = NULL, col_breaks_n = 5, col_drop = FALSE, col_expand_limits = NULL, col_label = NULL, col_labels = NULL, col_legend_ncol = NULL, col_legend_nrow = NULL, col_legend_rev = FALSE, col_palette = NULL, col_palette_na = NULL, col_rescale = scales::rescale(), col_steps = FALSE, col_transform = NULL, facet_axes = NULL, facet_axis_labels = "margins", facet_drop = FALSE, facet_labels = NULL, facet_layout = NULL, facet_ncol = NULL, facet_nrow = NULL, facet_scales = "fixed", facet_space = "fixed", title = NULL, subtitle = NULL, caption = NULL, label_case = NULL )
data |
A data frame or tibble. |
... |
Other arguments passed to within a |
stat |
A statistical transformation to use on the data. A snakecase character string of a ggproto Stat subclass object minus the Stat prefix (e.g. |
position |
A position adjustment. A snakecase character string of a ggproto Position subclass object minus the Position prefix (e.g. |
coord |
A coordinate system. A |
theme |
A ggplot2 theme (e.g. |
theme_orientation |
The orientation of plot, which affects the theme components that are removed. Either |
theme_axis_line_rm |
|
theme_axis_ticks_rm |
|
theme_panel_grid_rm |
|
blend |
The blending mode per |
x , xmin , xmax , xend , y , ymin , ymax , yend , z , col , facet , facet2 , group , subgroup , label , text , sample
|
An unquoted aesthetic variable. |
mapping |
A set of additional aesthetic mappings in |
x_breaks , y_breaks , col_breaks
|
A |
x_breaks_n , y_breaks_n , col_breaks_n
|
A number of desired breaks for when |
x_expand , y_expand
|
Padding to the limits with the |
x_expand_limits , y_expand_limits , col_expand_limits
|
For a continuous variable, any values that the limits should encompass (e.g. |
x_label , y_label , col_label
|
Label for the axis or legend title. Use |
x_labels , y_labels , col_labels , facet_labels
|
A function that takes the breaks as inputs (e.g. |
x_position , y_position
|
The position of the axis (i.e. |
x_sec_axis , y_sec_axis
|
A secondary axis with |
x_symmetric , y_symmetric
|
|
x_transform , y_transform , col_transform
|
For a continuous scale, a transformation object (e.g. |
col_drop , facet_drop
|
For a discrete variable, FALSE or TRUE of whether to drop unused levels. |
col_legend_ncol , col_legend_nrow
|
The number of columns and rows in a legend guide. |
col_legend_rev |
|
col_palette |
A character vector of hex codes (or names) or a |
col_palette_na |
A hex code (or name) for the colour of |
col_rescale |
For a continuous variable, a |
col_steps |
For a continuous variable, |
facet_axes |
Whether to add interior axes and ticks with |
facet_axis_labels |
Whether to add interior axis labels with |
facet_layout |
Whether the layout is to be |
facet_ncol , facet_nrow
|
The number of columns and rows of facet panels. Only applies to a facet layout of |
facet_scales |
Whether facet scales should be |
facet_space |
When the facet scales are not |
title |
Title string. |
subtitle |
Subtitle string. |
caption |
Caption title string. |
label_case |
A function to format the label of unlabelled variables. Defaults to |
A ggplot object.
library(ggplot2) library(dplyr) library(palmerpenguins) set_blanket() penguins |> tidyr::drop_na(sex) |> gg_violin( x = species, y = body_mass_g, col = sex, )
library(ggplot2) library(dplyr) library(palmerpenguins) set_blanket() penguins |> tidyr::drop_na(sex) |> gg_violin( x = species, y = body_mass_g, col = sex, )
A grey colour.
grey
grey
A character vector.
scales::show_col(grey)
scales::show_col(grey)
A discrete palette that is relatively colour-blind safe.
jumble teal orange navy red pink purple
jumble teal orange navy red pink purple
A character vector.
colorspace::swatchplot(c(jumble, grey), cvd = TRUE)
colorspace::swatchplot(c(jumble, grey), cvd = TRUE)
Label every nth element in a vector, and replace the rest with "".
label_every_nth(n = 2, offset = 0, ...)
label_every_nth(n = 2, offset = 0, ...)
n |
The increment of elements to hold as is. Defaults to |
offset |
An offset for which element to first hold. Defaults to |
... |
If numeric, arguments passed to the |
A labelling function
label_every_nth()(scales::comma(seq(1000, 5000, 1000))) label_every_nth()(lubridate::ymd(c("2021-01-01", "2022-01-01", "2023-01-01", "2024-01-01"))) label_every_nth()(LETTERS[1:12]) library(dplyr) library(palmerpenguins) set_blanket() penguins |> mutate(across(sex, \(x) stringr::str_to_sentence(x))) |> gg_point( x = flipper_length_mm, y = body_mass_g, col = sex, x_labels = label_every_nth(), y_labels = label_every_nth(), )
label_every_nth()(scales::comma(seq(1000, 5000, 1000))) label_every_nth()(lubridate::ymd(c("2021-01-01", "2022-01-01", "2023-01-01", "2024-01-01"))) label_every_nth()(LETTERS[1:12]) library(dplyr) library(palmerpenguins) set_blanket() penguins |> mutate(across(sex, \(x) stringr::str_to_sentence(x))) |> gg_point( x = flipper_length_mm, y = body_mass_g, col = sex, x_labels = label_every_nth(), y_labels = label_every_nth(), )
A dark mode family of functions:
light_mode_r()
with legend on right
light_mode_t()
with legend on top
light_mode_b()
with legend on bottom
light_mode_r( ..., base_size = 11, base_family = "", base_colour = "#121B24FF", axis_line_colour = "#121B24FF", axis_line_linewidth = 0.25, axis_ticks_colour = axis_line_colour, axis_ticks_linewidth = axis_line_linewidth, panel_grid_colour = "#F6F8FAFF", panel_grid_linewidth = 1.33, panel_background_fill = "#FFFFFFFF", plot_background_fill = "#FFFFFFFF", legend_axis_line_colour = plot_background_fill, legend_axis_line_linewidth = axis_line_linewidth, legend_background_fill = plot_background_fill, legend_key_fill = plot_background_fill, legend_ticks_colour = legend_axis_line_colour, legend_ticks_linewidth = legend_axis_line_linewidth, legend_ticks_length = ggplot2::rel(c(0.175, 0)) ) light_mode_t( ..., base_size = 11, base_family = "", base_colour = "#121B24FF", axis_line_colour = "#121B24FF", axis_line_linewidth = 0.25, axis_ticks_colour = axis_line_colour, axis_ticks_linewidth = axis_line_linewidth, panel_grid_colour = "#F6F8FAFF", panel_grid_linewidth = 1.33, panel_background_fill = "#FFFFFFFF", plot_background_fill = "#FFFFFFFF", legend_axis_line_colour = plot_background_fill, legend_axis_line_linewidth = axis_line_linewidth, legend_background_fill = plot_background_fill, legend_key_fill = plot_background_fill, legend_ticks_colour = legend_axis_line_colour, legend_ticks_linewidth = legend_axis_line_linewidth, legend_ticks_length = ggplot2::rel(c(0.175, 0)) ) light_mode_b( ..., base_size = 11, base_family = "", base_colour = "#121B24FF", axis_line_colour = "#121B24FF", axis_line_linewidth = 0.25, axis_ticks_colour = axis_line_colour, axis_ticks_linewidth = axis_line_linewidth, panel_grid_colour = "#F6F8FAFF", panel_grid_linewidth = 1.33, panel_background_fill = "#FFFFFFFF", plot_background_fill = "#FFFFFFFF", legend_axis_line_colour = plot_background_fill, legend_axis_line_linewidth = axis_line_linewidth, legend_background_fill = plot_background_fill, legend_key_fill = plot_background_fill, legend_ticks_colour = legend_axis_line_colour, legend_ticks_linewidth = legend_axis_line_linewidth, legend_ticks_length = ggplot2::rel(c(0.175, 0)) )
light_mode_r( ..., base_size = 11, base_family = "", base_colour = "#121B24FF", axis_line_colour = "#121B24FF", axis_line_linewidth = 0.25, axis_ticks_colour = axis_line_colour, axis_ticks_linewidth = axis_line_linewidth, panel_grid_colour = "#F6F8FAFF", panel_grid_linewidth = 1.33, panel_background_fill = "#FFFFFFFF", plot_background_fill = "#FFFFFFFF", legend_axis_line_colour = plot_background_fill, legend_axis_line_linewidth = axis_line_linewidth, legend_background_fill = plot_background_fill, legend_key_fill = plot_background_fill, legend_ticks_colour = legend_axis_line_colour, legend_ticks_linewidth = legend_axis_line_linewidth, legend_ticks_length = ggplot2::rel(c(0.175, 0)) ) light_mode_t( ..., base_size = 11, base_family = "", base_colour = "#121B24FF", axis_line_colour = "#121B24FF", axis_line_linewidth = 0.25, axis_ticks_colour = axis_line_colour, axis_ticks_linewidth = axis_line_linewidth, panel_grid_colour = "#F6F8FAFF", panel_grid_linewidth = 1.33, panel_background_fill = "#FFFFFFFF", plot_background_fill = "#FFFFFFFF", legend_axis_line_colour = plot_background_fill, legend_axis_line_linewidth = axis_line_linewidth, legend_background_fill = plot_background_fill, legend_key_fill = plot_background_fill, legend_ticks_colour = legend_axis_line_colour, legend_ticks_linewidth = legend_axis_line_linewidth, legend_ticks_length = ggplot2::rel(c(0.175, 0)) ) light_mode_b( ..., base_size = 11, base_family = "", base_colour = "#121B24FF", axis_line_colour = "#121B24FF", axis_line_linewidth = 0.25, axis_ticks_colour = axis_line_colour, axis_ticks_linewidth = axis_line_linewidth, panel_grid_colour = "#F6F8FAFF", panel_grid_linewidth = 1.33, panel_background_fill = "#FFFFFFFF", plot_background_fill = "#FFFFFFFF", legend_axis_line_colour = plot_background_fill, legend_axis_line_linewidth = axis_line_linewidth, legend_background_fill = plot_background_fill, legend_key_fill = plot_background_fill, legend_ticks_colour = legend_axis_line_colour, legend_ticks_linewidth = legend_axis_line_linewidth, legend_ticks_length = ggplot2::rel(c(0.175, 0)) )
... |
Provided to require argument naming, support trailing commas etc. |
base_size |
The base size of the text theme element. Defaults to 11. |
base_family |
The base family of the text theme element. Defaults to "". |
base_colour |
The base colour of the text theme element. |
axis_line_colour |
The colour of the axis.line theme element. |
axis_line_linewidth |
The linewidth of the axis.line theme element. |
axis_ticks_colour |
The colour of the axis.ticks theme element. |
axis_ticks_linewidth |
The linewidth of the axis.ticks theme element. |
panel_grid_colour |
The colour of the panel.grid theme element. |
panel_grid_linewidth |
The linewidth of the panel.grid theme element. |
panel_background_fill |
The fill (and colour) of the panel.background theme element. |
plot_background_fill |
The fill (and colour) of the plot.background theme element. |
legend_axis_line_colour |
The colour of the legend.axis.line theme element. |
legend_axis_line_linewidth |
The linewidth of the legend.axis.line theme element. |
legend_background_fill |
The fill (and colour) of the legend.background theme element. |
legend_key_fill |
The fill (and colour) of the legend.key theme element. |
legend_ticks_colour |
The colour of the legend.ticks theme element. |
legend_ticks_linewidth |
The linewidth of the legend.ticks theme element. |
legend_ticks_length |
The legend.ticks.length theme element. |
A ggplot theme.
library(palmerpenguins) library(ggplot2) set_blanket() penguins |> gg_point( x = flipper_length_mm, y = body_mass_g, col = species, mode = light_mode_r() ) penguins |> gg_point( x = flipper_length_mm, y = body_mass_g, col = species, mode = light_mode_t() ) penguins |> gg_point( x = flipper_length_mm, y = body_mass_g, col = species, mode = light_mode_b() )
library(palmerpenguins) library(ggplot2) set_blanket() penguins |> gg_point( x = flipper_length_mm, y = body_mass_g, col = species, mode = light_mode_r() ) penguins |> gg_point( x = flipper_length_mm, y = body_mass_g, col = species, mode = light_mode_t() ) penguins |> gg_point( x = flipper_length_mm, y = body_mass_g, col = species, mode = light_mode_b() )
lightness
and darkness
are vectors of 3 colours used in the *_theme_*
themes for the for the text, axis.line (and axis.ticks), panel.grid, panel.background and plot.background etc.
linewidthness
is a vector of 2 integers used in the *_theme_*
themes for the linewidth of the axis.line (axis.ticks and legend.ticks) and panel.grid theme elements.
lightness darkness linewidthness
lightness darkness linewidthness
A character vector.
scales::show_col(c(lightness, darkness), ncol = 3)
scales::show_col(c(lightness, darkness), ncol = 3)
Set the style by setting:
the geom defaults, including the colour (and fill) of geoms (i.e. weave_geom_defaults
)
the colour (and fill) palettes (i.e. discrete, continuous and ordinal) (i.e. weave_col_palette
)
the theme, and how/what side-effects are to be applied (i.e. weave_theme
)
the function to apply to a unspecified/unlabelled x_label
, y_label
, col_label
etc (i.e. weave_label_case
).
set_font_defaults()
and set_reference_defaults()
can be used to customise "text", "label", "abline, "vline" and "hline" geom defaults.
ggplot2::update_geom_defaults()
can be used to further fine-tune geom defaults.
set_blanket( ..., colour = "#357BA2FF", col_palette_d = jumble, col_palette_c = viridisLite::mako(n = 9, direction = -1), col_palette_o = scales::pal_viridis(option = "G", direction = -1), col_palette_na_d = "#CDC5BFFF", col_palette_na_c = "#988F88FF", col_palette_na_o = "#988F88FF", theme = light_mode_r(), theme_orientation = NULL, theme_axis_line_rm = TRUE, theme_axis_ticks_rm = TRUE, theme_panel_grid_rm = TRUE, label_case = snakecase::to_sentence_case )
set_blanket( ..., colour = "#357BA2FF", col_palette_d = jumble, col_palette_c = viridisLite::mako(n = 9, direction = -1), col_palette_o = scales::pal_viridis(option = "G", direction = -1), col_palette_na_d = "#CDC5BFFF", col_palette_na_c = "#988F88FF", col_palette_na_o = "#988F88FF", theme = light_mode_r(), theme_orientation = NULL, theme_axis_line_rm = TRUE, theme_axis_ticks_rm = TRUE, theme_panel_grid_rm = TRUE, label_case = snakecase::to_sentence_case )
... |
Provided to require argument naming, support trailing commas etc. |
colour |
For most geoms, a default hex code for the colour of geoms (i.e. geoms other than "text", "label", "hline", "vline" and "abline"). Note "fill" inherits from this argument. |
col_palette_d |
For a discrete scale, a character vector of hex codes. |
col_palette_c |
For a continuous scale, a character vector of hex codes. |
col_palette_o |
For an ordinal scale, a |
col_palette_na_d |
For a discrete scale, a hex code. |
col_palette_na_c |
For a continuous scale, a hex code. |
col_palette_na_o |
For an ordinal scale, a hex code. |
theme |
A ggplot2 theme (e.g. |
theme_orientation |
The orientation of plot, which affects the theme components that can be removed by the |
theme_axis_line_rm |
|
theme_axis_ticks_rm |
|
theme_panel_grid_rm |
|
label_case |
A function to apply to a unspecified/unlabelled |
A globally set style.
library(ggplot2) library(ggblanket) library(palmerpenguins) set_blanket( theme = dark_mode_r(), colour = "#E7298AFF", col_palette_d = c("#1B9E77FF", "#D95F02FF", "#7570b3FF", "#E7298AFF", "#66A61EFF", "#E6AB02FF", "#A6761DFF", "#666666FF"), ) penguins |> gg_point( x = flipper_length_mm, y = body_mass_g, ) penguins |> gg_histogram( x = flipper_length_mm, col = species, )
library(ggplot2) library(ggblanket) library(palmerpenguins) set_blanket( theme = dark_mode_r(), colour = "#E7298AFF", col_palette_d = c("#1B9E77FF", "#D95F02FF", "#7570b3FF", "#E7298AFF", "#66A61EFF", "#E6AB02FF", "#A6761DFF", "#666666FF"), ) penguins |> gg_point( x = flipper_length_mm, y = body_mass_g, ) penguins |> gg_histogram( x = flipper_length_mm, col = species, )
Update the "text" and "label" geom defaults. Note all other text is controlled by the theme.
set_font_defaults( ..., colour = "#121B24FF", fill = "#FFFFFFFF", size = 11/2.835052, family = "" )
set_font_defaults( ..., colour = "#121B24FF", fill = "#FFFFFFFF", size = 11/2.835052, family = "" )
... |
Provided to require argument naming, support trailing commas etc. |
colour |
A hex code. |
fill |
A hex code. |
size |
A size. |
family |
A family. |
library(ggplot2) library(dplyr) library(palmerpenguins) set_blanket(theme = dark_mode_r()) set_font_defaults(colour = darkness[1]) set_reference_defaults(colour = darkness[1]) penguins |> gg_point( x = flipper_length_mm, y = body_mass_g, x_breaks_n = 4, ) + geom_vline(xintercept = 200) + annotate("text", x = I(0.25), y = I(0.75), label = "Here")
library(ggplot2) library(dplyr) library(palmerpenguins) set_blanket(theme = dark_mode_r()) set_font_defaults(colour = darkness[1]) set_reference_defaults(colour = darkness[1]) penguins |> gg_point( x = flipper_length_mm, y = body_mass_g, x_breaks_n = 4, ) + geom_vline(xintercept = 200) + annotate("text", x = I(0.25), y = I(0.75), label = "Here")
Update the "abline", "hline" and "vline" geom defaults.
set_reference_defaults(..., colour = "#121B24FF", linewidth = 0.25)
set_reference_defaults(..., colour = "#121B24FF", linewidth = 0.25)
... |
Provided to require argument naming, support trailing commas etc. |
colour |
A hex code. |
linewidth |
A linewidth. |
library(ggplot2) library(dplyr) library(palmerpenguins) set_blanket(theme = dark_mode_r()) set_font_defaults(colour = darkness[1]) set_reference_defaults(colour = darkness[1]) penguins |> gg_point( x = flipper_length_mm, y = body_mass_g, x_breaks_n = 4, ) + geom_vline(xintercept = 200) + annotate("text", x = I(0.25), y = I(0.75), label = "Here")
library(ggplot2) library(dplyr) library(palmerpenguins) set_blanket(theme = dark_mode_r()) set_font_defaults(colour = darkness[1]) set_reference_defaults(colour = darkness[1]) penguins |> gg_point( x = flipper_length_mm, y = body_mass_g, x_breaks_n = 4, ) + geom_vline(xintercept = 200) + annotate("text", x = I(0.25), y = I(0.75), label = "Here")
Set colour (and fill) palettes
weave_col_palette( ..., col_palette_d = jumble, col_palette_c = viridisLite::mako(n = 9, direction = -1), col_palette_o = scales::pal_viridis(option = "G", direction = -1), col_palette_na_d = "#CDC5BFFF", col_palette_na_c = "#988F88FF", col_palette_na_o = "#988F88FF" )
weave_col_palette( ..., col_palette_d = jumble, col_palette_c = viridisLite::mako(n = 9, direction = -1), col_palette_o = scales::pal_viridis(option = "G", direction = -1), col_palette_na_d = "#CDC5BFFF", col_palette_na_c = "#988F88FF", col_palette_na_o = "#988F88FF" )
... |
Provided to require argument naming, support trailing commas etc. |
col_palette_d |
For a discrete scale, a character vector of hex codes. Use NULL for ggplot2 default. Use NULL to leave as is. |
col_palette_c |
For a continuous scale, a character vector of hex codes. Use NULL for ggplot2 default. Use NULL to leave as is. |
col_palette_o |
For an ordinal scale, a |
col_palette_na_d |
For a discrete scale, a hex code. |
col_palette_na_c |
For a continuous scale, a hex code. |
col_palette_na_o |
For an ordinal scale, a hex code. |
Update all the geom defaults.
ggplot2::update_geom_defaults()
can be used to further fine-tune individual geom defaults.
weave_geom_defaults(..., colour = "#357BA2FF")
weave_geom_defaults(..., colour = "#357BA2FF")
... |
Provided to require argument naming, support trailing commas etc. |
colour |
For most geoms, a default hex code for the colour of geoms (i.e. geoms other than "text", "label", "hline", "vline" and "abline"). Note "fill" inherits from this argument. |
Set a function to format the label of unlabelled variables.
weave_label_case(label_case = snakecase::to_sentence_case, ...)
weave_label_case(label_case = snakecase::to_sentence_case, ...)
label_case |
A function to apply to a unspecified/unlabelled |
... |
Provided to require argument naming, support trailing commas etc. |
Set a theme for the theme argument in gg_*
functions.
weave_theme( theme = light_mode_r(), ..., theme_orientation = NULL, theme_axis_line_rm = TRUE, theme_axis_ticks_rm = TRUE, theme_panel_grid_rm = TRUE )
weave_theme( theme = light_mode_r(), ..., theme_orientation = NULL, theme_axis_line_rm = TRUE, theme_axis_ticks_rm = TRUE, theme_panel_grid_rm = TRUE )
theme |
A ggplot2 theme (e.g. |
... |
Provided to require argument naming, support trailing commas etc. |
theme_orientation |
The orientation of plot, which affects the theme components that can be removed by the |
theme_axis_line_rm |
|
theme_axis_ticks_rm |
|
theme_panel_grid_rm |
|