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: | 11.0.0 |
Built: | 2024-11-22 04:26:00 UTC |
Source: | https://github.com/davidhodge931/ggblanket |
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 force user argument naming 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), mode = 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), mode = 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, )
Lighten/darken a colour/fill aesthetic based on a
aes_colour_darken()
Darken a colour aesthetic, relative to a fill aesthetic
aes_colour_lighten()
Lighten a colour aesthetic, relative to the fill aesthetic
aes_fill_darken()
Darken a fill aesthetic, relative to a colour aesthetic
aes_fill_lighten()
Lighten a fill aesthetic, relative to the colour aesthetic
Can be spliced into ggplot2::aes with rlang::!!!.
aes_colour_darken(..., amount = 0.1) aes_colour_lighten(..., amount = 0.1) aes_fill_darken(..., amount = 0.1) aes_fill_lighten(..., amount = 0.1)
aes_colour_darken(..., amount = 0.1) aes_colour_lighten(..., amount = 0.1) aes_fill_darken(..., amount = 0.1) aes_fill_lighten(..., amount = 0.1)
... |
Other arguments passed to |
amount |
Numeric specifying the amount of lightening or darkening. |
A ggplot2 aesthetic
library(ggblanket) library(ggplot2) library(palmerpenguins) set_blanket( alpha_recursive = 1, ) penguins |> gg_bar( y = species, col = island, mapping = aes_colour_darken(amount = 0.2), width = 0.75, ) penguins |> gg_bar( y = species, col = island, mapping = aes(!!!aes_colour_darken(amount = 0.2)), width = 0.75, )
library(ggblanket) library(ggplot2) library(palmerpenguins) set_blanket( alpha_recursive = 1, ) penguins |> gg_bar( y = species, col = island, mapping = aes_colour_darken(amount = 0.2), width = 0.75, ) penguins |> gg_bar( y = species, col = island, mapping = aes(!!!aes_colour_darken(amount = 0.2)), width = 0.75, )
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.33, 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 = 0.33, 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.33, 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 = 0.33, 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.33, 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 = 0.33, 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.33, 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 = 0.33, 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.33, 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 = 0.33, 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.33, 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 = 0.33, 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 force user argument naming 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"), mode = NULL, mode_orientation = 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_to_case = snakecase::to_sentence_case )
gg_area( data = NULL, ..., stat = "align", position = "stack", coord = ggplot2::coord_cartesian(clip = "off"), mode = NULL, mode_orientation = 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_to_case = snakecase::to_sentence_case )
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 |
mode |
A ggplot2 theme (e.g. |
mode_orientation |
The orientation of plot, which affects the theme components that are removed from the mode. Either "x" or "y". |
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_to_case |
A function to format the default |
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"), mode = NULL, mode_orientation = 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_to_case = snakecase::to_sentence_case )
gg_bar( data = NULL, ..., stat = "count", position = "stack", coord = ggplot2::coord_cartesian(clip = "off"), mode = NULL, mode_orientation = 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_to_case = snakecase::to_sentence_case )
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 |
mode |
A ggplot2 theme (e.g. |
mode_orientation |
The orientation of plot, which affects the theme components that are removed from the mode. Either "x" or "y". |
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_to_case |
A function to format the default |
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"), mode = NULL, mode_orientation = 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_to_case = snakecase::to_sentence_case )
gg_bin_2d( data = NULL, ..., stat = "bin2d", position = "identity", coord = ggplot2::coord_cartesian(clip = "off"), mode = NULL, mode_orientation = 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_to_case = snakecase::to_sentence_case )
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 |
mode |
A ggplot2 theme (e.g. |
mode_orientation |
The orientation of plot, which affects the theme components that are removed from the mode. Either "x" or "y". |
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_to_case |
A function to format the default |
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, mode = NULL, mode_orientation = 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_to_case = snakecase::to_sentence_case )
gg_blanket( data = NULL, ..., geom = "blank", stat = "identity", position = "identity", coord = NULL, mode = NULL, mode_orientation = 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_to_case = snakecase::to_sentence_case )
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 |
mode |
A ggplot2 theme (e.g. |
mode_orientation |
The orientation of plot, which affects the theme components that are removed from the mode. Either "x" or "y". |
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_to_case |
A function to format the default |
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"), mode = NULL, mode_orientation = 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_to_case = snakecase::to_sentence_case )
gg_boxplot( data = NULL, ..., stat = "boxplot", position = "dodge2", coord = ggplot2::coord_cartesian(clip = "off"), mode = NULL, mode_orientation = 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_to_case = snakecase::to_sentence_case )
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 |
mode |
A ggplot2 theme (e.g. |
mode_orientation |
The orientation of plot, which affects the theme components that are removed from the mode. Either "x" or "y". |
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_to_case |
A function to format the default |
A ggplot object.
library(ggplot2) library(dplyr) library(palmerpenguins) set_blanket() penguins |> gg_boxplot( x = flipper_length_mm, y = species, col = sex, )
library(ggplot2) library(dplyr) library(palmerpenguins) set_blanket() penguins |> gg_boxplot( x = flipper_length_mm, y = species, col = sex, )
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"), mode = NULL, mode_orientation = 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_to_case = snakecase::to_sentence_case )
gg_col( data = NULL, ..., stat = "identity", position = "stack", coord = ggplot2::coord_cartesian(clip = "off"), mode = NULL, mode_orientation = 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_to_case = snakecase::to_sentence_case )
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 |
mode |
A ggplot2 theme (e.g. |
mode_orientation |
The orientation of plot, which affects the theme components that are removed from the mode. Either "x" or "y". |
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_to_case |
A function to format the default |
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"), mode = NULL, mode_orientation = 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_to_case = snakecase::to_sentence_case )
gg_contour( data = NULL, ..., stat = "contour", position = "identity", coord = ggplot2::coord_cartesian(clip = "off"), mode = NULL, mode_orientation = 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_to_case = snakecase::to_sentence_case )
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 |
mode |
A ggplot2 theme (e.g. |
mode_orientation |
The orientation of plot, which affects the theme components that are removed from the mode. Either "x" or "y". |
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_to_case |
A function to format the default |
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"), mode = NULL, mode_orientation = 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_to_case = snakecase::to_sentence_case )
gg_contour_filled( data = NULL, ..., stat = "contour_filled", position = "identity", coord = ggplot2::coord_cartesian(clip = "off"), mode = NULL, mode_orientation = 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_to_case = snakecase::to_sentence_case )
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 |
mode |
A ggplot2 theme (e.g. |
mode_orientation |
The orientation of plot, which affects the theme components that are removed from the mode. Either "x" or "y". |
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_to_case |
A function to format the default |
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"), mode = NULL, mode_orientation = 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_to_case = snakecase::to_sentence_case )
gg_crossbar( data = NULL, ..., stat = "identity", position = "identity", coord = ggplot2::coord_cartesian(clip = "off"), mode = NULL, mode_orientation = 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_to_case = snakecase::to_sentence_case )
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 |
mode |
A ggplot2 theme (e.g. |
mode_orientation |
The orientation of plot, which affects the theme components that are removed from the mode. Either "x" or "y". |
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_to_case |
A function to format the default |
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", )
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", )
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"), mode = NULL, mode_orientation = 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_to_case = snakecase::to_sentence_case )
gg_density( data = NULL, ..., stat = "density", position = "identity", coord = ggplot2::coord_cartesian(clip = "off"), mode = NULL, mode_orientation = 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_to_case = snakecase::to_sentence_case )
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 |
mode |
A ggplot2 theme (e.g. |
mode_orientation |
The orientation of plot, which affects the theme components that are removed from the mode. Either "x" or "y". |
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_to_case |
A function to format the default |
A ggplot object.
library(ggplot2) library(dplyr) library(palmerpenguins) set_blanket() penguins |> gg_density( x = flipper_length_mm, col = species, )
library(ggplot2) library(dplyr) library(palmerpenguins) set_blanket() penguins |> gg_density( x = flipper_length_mm, col = species, )
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"), mode = NULL, mode_orientation = 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_to_case = snakecase::to_sentence_case )
gg_density_2d( data = NULL, ..., stat = "density_2d", position = "identity", coord = ggplot2::coord_cartesian(clip = "off"), mode = NULL, mode_orientation = 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_to_case = snakecase::to_sentence_case )
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 |
mode |
A ggplot2 theme (e.g. |
mode_orientation |
The orientation of plot, which affects the theme components that are removed from the mode. Either "x" or "y". |
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_to_case |
A function to format the default |
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"), mode = NULL, mode_orientation = 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_to_case = snakecase::to_sentence_case )
gg_density_2d_filled( data = NULL, ..., stat = "density_2d_filled", position = "identity", coord = ggplot2::coord_cartesian(clip = "off"), mode = NULL, mode_orientation = 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_to_case = snakecase::to_sentence_case )
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 |
mode |
A ggplot2 theme (e.g. |
mode_orientation |
The orientation of plot, which affects the theme components that are removed from the mode. Either "x" or "y". |
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_to_case |
A function to format the default |
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"), mode = NULL, mode_orientation = 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_to_case = snakecase::to_sentence_case )
gg_errorbar( data = NULL, ..., stat = "identity", position = "identity", coord = ggplot2::coord_cartesian(clip = "off"), mode = NULL, mode_orientation = 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_to_case = snakecase::to_sentence_case )
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 |
mode |
A ggplot2 theme (e.g. |
mode_orientation |
The orientation of plot, which affects the theme components that are removed from the mode. Either "x" or "y". |
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_to_case |
A function to format the default |
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"), mode = NULL, mode_orientation = 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_to_case = snakecase::to_sentence_case )
gg_freqpoly( data = NULL, ..., stat = "bin", position = "identity", coord = ggplot2::coord_cartesian(clip = "off"), mode = NULL, mode_orientation = 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_to_case = snakecase::to_sentence_case )
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 |
mode |
A ggplot2 theme (e.g. |
mode_orientation |
The orientation of plot, which affects the theme components that are removed from the mode. Either "x" or "y". |
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_to_case |
A function to format the default |
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"), mode = NULL, mode_orientation = 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_to_case = snakecase::to_sentence_case )
gg_function( data = NULL, ..., stat = "function", position = "identity", coord = ggplot2::coord_cartesian(clip = "off"), mode = NULL, mode_orientation = 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_to_case = snakecase::to_sentence_case )
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 |
mode |
A ggplot2 theme (e.g. |
mode_orientation |
The orientation of plot, which affects the theme components that are removed from the mode. Either "x" or "y". |
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_to_case |
A function to format the default |
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"), mode = NULL, mode_orientation = 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_to_case = snakecase::to_sentence_case )
gg_hex( data = NULL, ..., stat = "binhex", position = "identity", coord = ggplot2::coord_cartesian(clip = "off"), mode = NULL, mode_orientation = 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_to_case = snakecase::to_sentence_case )
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 |
mode |
A ggplot2 theme (e.g. |
mode_orientation |
The orientation of plot, which affects the theme components that are removed from the mode. Either "x" or "y". |
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_to_case |
A function to format the default |
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"), mode = NULL, mode_orientation = 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_to_case = snakecase::to_sentence_case )
gg_histogram( data = NULL, ..., stat = "bin", position = "stack", coord = ggplot2::coord_cartesian(clip = "off"), mode = NULL, mode_orientation = 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_to_case = snakecase::to_sentence_case )
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 |
mode |
A ggplot2 theme (e.g. |
mode_orientation |
The orientation of plot, which affects the theme components that are removed from the mode. Either "x" or "y". |
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_to_case |
A function to format the default |
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"), mode = NULL, mode_orientation = 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_to_case = snakecase::to_sentence_case )
gg_jitter( data = NULL, ..., stat = "identity", position = "jitter", coord = ggplot2::coord_cartesian(clip = "off"), mode = NULL, mode_orientation = 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_to_case = snakecase::to_sentence_case )
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 |
mode |
A ggplot2 theme (e.g. |
mode_orientation |
The orientation of plot, which affects the theme components that are removed from the mode. Either "x" or "y". |
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_to_case |
A function to format the default |
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"), mode = NULL, mode_orientation = 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_to_case = snakecase::to_sentence_case )
gg_label( data = NULL, ..., stat = "identity", position = "identity", coord = ggplot2::coord_cartesian(clip = "off"), mode = NULL, mode_orientation = 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_to_case = snakecase::to_sentence_case )
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 |
mode |
A ggplot2 theme (e.g. |
mode_orientation |
The orientation of plot, which affects the theme components that are removed from the mode. Either "x" or "y". |
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_to_case |
A function to format the default |
A ggplot object.
library(ggplot2) library(dplyr) set_blanket() bind_rows( mtcars |> slice_min(order_by = mpg), mtcars |> slice_max(order_by = mpg) ) |> tibble::rownames_to_column("model") |> gg_label( x = model, y = mpg, col = mpg, label = model, y_expand_limits = 0, y_label = "Miles per gallon", col_palette = c(orange, "white", teal), )
library(ggplot2) library(dplyr) set_blanket() bind_rows( mtcars |> slice_min(order_by = mpg), mtcars |> slice_max(order_by = mpg) ) |> tibble::rownames_to_column("model") |> gg_label( x = model, y = mpg, col = mpg, label = model, 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"), mode = NULL, mode_orientation = 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_to_case = snakecase::to_sentence_case )
gg_line( data = NULL, ..., stat = "identity", position = "identity", coord = ggplot2::coord_cartesian(clip = "off"), mode = NULL, mode_orientation = 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_to_case = snakecase::to_sentence_case )
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 |
mode |
A ggplot2 theme (e.g. |
mode_orientation |
The orientation of plot, which affects the theme components that are removed from the mode. Either "x" or "y". |
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_to_case |
A function to format the default |
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"), mode = NULL, mode_orientation = 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_to_case = snakecase::to_sentence_case )
gg_linerange( data = NULL, ..., stat = "identity", position = "identity", coord = ggplot2::coord_cartesian(clip = "off"), mode = NULL, mode_orientation = 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_to_case = snakecase::to_sentence_case )
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 |
mode |
A ggplot2 theme (e.g. |
mode_orientation |
The orientation of plot, which affects the theme components that are removed from the mode. Either "x" or "y". |
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_to_case |
A function to format the default |
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"), mode = NULL, mode_orientation = 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_to_case = snakecase::to_sentence_case )
gg_path( data = NULL, ..., stat = "identity", position = "identity", coord = ggplot2::coord_cartesian(clip = "off"), mode = NULL, mode_orientation = 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_to_case = snakecase::to_sentence_case )
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 |
mode |
A ggplot2 theme (e.g. |
mode_orientation |
The orientation of plot, which affects the theme components that are removed from the mode. Either "x" or "y". |
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_to_case |
A function to format the default |
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"), mode = NULL, mode_orientation = 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_to_case = snakecase::to_sentence_case )
gg_point( data = NULL, ..., stat = "identity", position = "identity", coord = ggplot2::coord_cartesian(clip = "off"), mode = NULL, mode_orientation = 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_to_case = snakecase::to_sentence_case )
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 |
mode |
A ggplot2 theme (e.g. |
mode_orientation |
The orientation of plot, which affects the theme components that are removed from the mode. Either "x" or "y". |
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_to_case |
A function to format the default |
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"), mode = NULL, mode_orientation = 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_to_case = snakecase::to_sentence_case )
gg_pointrange( data = NULL, ..., stat = "identity", position = "identity", coord = ggplot2::coord_cartesian(clip = "off"), mode = NULL, mode_orientation = 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_to_case = snakecase::to_sentence_case )
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 |
mode |
A ggplot2 theme (e.g. |
mode_orientation |
The orientation of plot, which affects the theme components that are removed from the mode. Either "x" or "y". |
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_to_case |
A function to format the default |
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"), mode = NULL, mode_orientation = 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_to_case = snakecase::to_sentence_case )
gg_polygon( data = NULL, ..., stat = "identity", position = "identity", coord = ggplot2::coord_cartesian(clip = "off"), mode = NULL, mode_orientation = 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_to_case = snakecase::to_sentence_case )
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 |
mode |
A ggplot2 theme (e.g. |
mode_orientation |
The orientation of plot, which affects the theme components that are removed from the mode. Either "x" or "y". |
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_to_case |
A function to format the default |
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"), mode = NULL, mode_orientation = 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_to_case = snakecase::to_sentence_case )
gg_qq( data = NULL, ..., stat = "qq", position = "identity", coord = ggplot2::coord_cartesian(clip = "off"), mode = NULL, mode_orientation = 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_to_case = snakecase::to_sentence_case )
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 |
mode |
A ggplot2 theme (e.g. |
mode_orientation |
The orientation of plot, which affects the theme components that are removed from the mode. Either "x" or "y". |
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_to_case |
A function to format the default |
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"), mode = NULL, mode_orientation = 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_to_case = snakecase::to_sentence_case )
gg_quantile( data = NULL, ..., stat = "quantile", position = "identity", coord = ggplot2::coord_cartesian(clip = "off"), mode = NULL, mode_orientation = 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_to_case = snakecase::to_sentence_case )
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 |
mode |
A ggplot2 theme (e.g. |
mode_orientation |
The orientation of plot, which affects the theme components that are removed from the mode. Either "x" or "y". |
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_to_case |
A function to format the default |
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"), mode = NULL, mode_orientation = 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_to_case = snakecase::to_sentence_case )
gg_raster( data = NULL, ..., stat = "identity", position = "identity", coord = ggplot2::coord_cartesian(clip = "off"), mode = NULL, mode_orientation = 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_to_case = snakecase::to_sentence_case )
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 |
mode |
A ggplot2 theme (e.g. |
mode_orientation |
The orientation of plot, which affects the theme components that are removed from the mode. Either "x" or "y". |
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_to_case |
A function to format the default |
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"), mode = NULL, mode_orientation = 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_to_case = snakecase::to_sentence_case )
gg_rect( data = NULL, ..., stat = "identity", position = "identity", coord = ggplot2::coord_cartesian(clip = "off"), mode = NULL, mode_orientation = 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_to_case = snakecase::to_sentence_case )
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 |
mode |
A ggplot2 theme (e.g. |
mode_orientation |
The orientation of plot, which affects the theme components that are removed from the mode. Either "x" or "y". |
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_to_case |
A function to format the default |
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"), mode = NULL, mode_orientation = 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_to_case = snakecase::to_sentence_case )
gg_ribbon( data = NULL, ..., stat = "identity", position = "identity", coord = ggplot2::coord_cartesian(clip = "off"), mode = NULL, mode_orientation = 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_to_case = snakecase::to_sentence_case )
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 |
mode |
A ggplot2 theme (e.g. |
mode_orientation |
The orientation of plot, which affects the theme components that are removed from the mode. Either "x" or "y". |
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_to_case |
A function to format the default |
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, y_label = "Level", ) + geom_line(mapping = aes(y = level))
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, y_label = "Level", ) + geom_line(mapping = aes(y = level))
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"), mode = NULL, mode_orientation = 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_to_case = snakecase::to_sentence_case )
gg_rug( data = NULL, ..., stat = "identity", position = "identity", coord = ggplot2::coord_cartesian(clip = "off"), mode = NULL, mode_orientation = 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_to_case = snakecase::to_sentence_case )
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 |
mode |
A ggplot2 theme (e.g. |
mode_orientation |
The orientation of plot, which affects the theme components that are removed from the mode. Either "x" or "y". |
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_to_case |
A function to format the default |
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"), mode = NULL, mode_orientation = 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_to_case = snakecase::to_sentence_case )
gg_segment( data = NULL, ..., stat = "identity", position = "identity", coord = ggplot2::coord_cartesian(clip = "off"), mode = NULL, mode_orientation = 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_to_case = snakecase::to_sentence_case )
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 |
mode |
A ggplot2 theme (e.g. |
mode_orientation |
The orientation of plot, which affects the theme components that are removed from the mode. Either "x" or "y". |
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_to_case |
A function to format the default |
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"), mode = NULL, mode_orientation = 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_to_case = snakecase::to_sentence_case )
gg_sf( data = NULL, ..., stat = "sf", position = "identity", coord = ggplot2::coord_sf(clip = "off"), mode = NULL, mode_orientation = 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_to_case = snakecase::to_sentence_case )
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 |
mode |
A ggplot2 theme (e.g. |
mode_orientation |
The orientation of plot, which affects the theme components that are removed from the mode. Either "x" or "y". |
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_to_case |
A function to format the default |
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"), mode = NULL, mode_orientation = 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_to_case = snakecase::to_sentence_case )
gg_smooth( data = NULL, ..., stat = "smooth", position = "identity", coord = ggplot2::coord_cartesian(clip = "off"), mode = NULL, mode_orientation = 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_to_case = snakecase::to_sentence_case )
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 |
mode |
A ggplot2 theme (e.g. |
mode_orientation |
The orientation of plot, which affects the theme components that are removed from the mode. Either "x" or "y". |
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_to_case |
A function to format the default |
A ggplot object.
library(ggplot2) library(dplyr) library(palmerpenguins) set_blanket() penguins |> gg_smooth( x = flipper_length_mm, y = body_mass_g, col = species, )
library(ggplot2) library(dplyr) library(palmerpenguins) set_blanket() penguins |> gg_smooth( x = flipper_length_mm, y = body_mass_g, col = species, )
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"), mode = NULL, mode_orientation = 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_to_case = snakecase::to_sentence_case )
gg_step( data = NULL, ..., stat = "identity", position = "identity", coord = ggplot2::coord_cartesian(clip = "off"), mode = NULL, mode_orientation = 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_to_case = snakecase::to_sentence_case )
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 |
mode |
A ggplot2 theme (e.g. |
mode_orientation |
The orientation of plot, which affects the theme components that are removed from the mode. Either "x" or "y". |
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_to_case |
A function to format the default |
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"), mode = NULL, mode_orientation = 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_to_case = snakecase::to_sentence_case )
gg_text( data = NULL, ..., stat = "identity", position = "identity", coord = ggplot2::coord_cartesian(clip = "off"), mode = NULL, mode_orientation = 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_to_case = snakecase::to_sentence_case )
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 |
mode |
A ggplot2 theme (e.g. |
mode_orientation |
The orientation of plot, which affects the theme components that are removed from the mode. Either "x" or "y". |
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_to_case |
A function to format the default |
A ggplot object.
library(ggplot2) library(dplyr) set_blanket() bind_rows( mtcars |> slice_min(order_by = mpg), mtcars |> slice_max(order_by = mpg) ) |> tibble::rownames_to_column("model") |> gg_text( x = model, y = mpg, col = mpg, label = model, y_expand_limits = 0, y_label = "Miles per gallon", col_palette = c(orange, "white", teal), )
library(ggplot2) library(dplyr) set_blanket() bind_rows( mtcars |> slice_min(order_by = mpg), mtcars |> slice_max(order_by = mpg) ) |> tibble::rownames_to_column("model") |> gg_text( x = model, y = mpg, col = mpg, label = model, 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"), mode = NULL, mode_orientation = 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_to_case = snakecase::to_sentence_case )
gg_tile( data = NULL, ..., stat = "identity", position = "identity", coord = ggplot2::coord_cartesian(clip = "off"), mode = NULL, mode_orientation = 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_to_case = snakecase::to_sentence_case )
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 |
mode |
A ggplot2 theme (e.g. |
mode_orientation |
The orientation of plot, which affects the theme components that are removed from the mode. Either "x" or "y". |
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_to_case |
A function to format the default |
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"), mode = NULL, mode_orientation = 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_to_case = snakecase::to_sentence_case )
gg_violin( data = NULL, ..., stat = "ydensity", position = "dodge", coord = ggplot2::coord_cartesian(clip = "off"), mode = NULL, mode_orientation = 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_to_case = snakecase::to_sentence_case )
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 |
mode |
A ggplot2 theme (e.g. |
mode_orientation |
The orientation of plot, which affects the theme components that are removed from the mode. Either "x" or "y". |
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_to_case |
A function to format the default |
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)
... |
If numeric, arguments passed to the |
n |
The increment of elements to hold as is. Defaults to |
offset |
An offset for which element to first hold. Defaults to |
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.33, 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 = 0.33, 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.33, 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 = 0.33, 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.33, 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 = 0.33, 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.33, 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 = 0.33, 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.33, 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 = 0.33, 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.33, 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 = 0.33, 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 force user argument naming 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 *_mode_*
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 *_mode_*
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)
gg_*
contextAdd theme components to a mode used outside of a gg_*
context
mode_orientation_to_x()
Orientate the plot to the x axis.
mode_orientation_to_y()
Orientate the plot to the y axis.
mode_orientation_to_x() mode_orientation_to_y()
mode_orientation_to_x() mode_orientation_to_y()
ggplot2 theme components.
library(ggplot2) library(palmerpenguins) penguins |> ggplot() + geom_point(aes(x = flipper_length_mm, y = body_mass_g)) + light_mode_r() + mode_orientation_to_x() penguins |> ggplot() + geom_bar(aes(y = island)) + light_mode_r() + mode_orientation_to_y()
library(ggplot2) library(palmerpenguins) penguins |> ggplot() + geom_point(aes(x = flipper_length_mm, y = body_mass_g)) + light_mode_r() + mode_orientation_to_x() penguins |> ggplot() + geom_bar(aes(y = island)) + light_mode_r() + mode_orientation_to_y()
Weave the style by setting:
the mode to be added with gg_*()
side-effects
the colour/fill geom default, and other defaults for text, reference line and curve geoms
the col_palettes for discrete, continuous and ordinal colour/fill scales
a theme to be added without gg_*()
side-effects.
Alternatively, use the weave_*
functions to only apply a subset of these.
ggplot2::update_geom_defaults()
can be used to further fine-tune geom defaults.
set_blanket( ..., mode = light_mode_r(), colour = "#357BA2FF", fill = colour, text_colour = "#121B24FF", text_size = 11/2.835052, text_family = "", reference_line_colour = "#121B24FF", reference_line_linewidth = 0.33, col_palette_d = jumble, col_palette_na_d = "#CDC5BFFF", col_palette_c = viridisLite::mako(n = 9, direction = -1), col_palette_na_c = "#988F88FF", col_palette_o = scales::pal_viridis(option = "G", direction = -1), col_palette_na_o = "#988F88FF", theme = light_mode_r() + mode_orientation_to_x() )
set_blanket( ..., mode = light_mode_r(), colour = "#357BA2FF", fill = colour, text_colour = "#121B24FF", text_size = 11/2.835052, text_family = "", reference_line_colour = "#121B24FF", reference_line_linewidth = 0.33, col_palette_d = jumble, col_palette_na_d = "#CDC5BFFF", col_palette_c = viridisLite::mako(n = 9, direction = -1), col_palette_na_c = "#988F88FF", col_palette_o = scales::pal_viridis(option = "G", direction = -1), col_palette_na_o = "#988F88FF", theme = light_mode_r() + mode_orientation_to_x() )
... |
Provided to force user argument naming etc. |
mode |
A ggplot2 theme (e.g. |
colour |
A default hex colour for the colour of geoms (other than text or reference line geoms). |
fill |
A default hex colour for the fill of geoms (other than text or reference line geoms). |
text_colour |
A default hex colour for the colour (and fill) of the "text" and "label" geoms. |
text_size |
A default size for the "text" and "label" geoms. |
text_family |
A default family for the "text" and "label" geoms. |
reference_line_colour |
A default hex colour for the colour of the "hline", "vline", "abline" and "curve" geoms. |
reference_line_linewidth |
A default linewidth for the the "hline", "vline", "abline" and "curve" geoms. |
col_palette_d |
For a discrete scale, a character vector of hex codes. |
col_palette_na_d |
For a discrete scale, a hex code. |
col_palette_c |
For a continuous scale, a character vector of hex codes. |
col_palette_na_c |
For a continuous scale, a hex code. |
col_palette_o |
For an ordinal scale, a |
col_palette_na_o |
For an ordinal scale, a hex code. |
theme |
A ggplot2 theme that the |
A globally set style.
library(ggplot2) library(ggblanket) library(palmerpenguins) set_blanket( mode = dark_mode_r(), colour = "#E7298AFF", text_colour = darkness[1], reference_line_colour = darkness[1], col_palette_d = c("#1B9E77FF", "#D95F02FF", "#7570b3FF", "#E7298AFF", "#66A61EFF", "#E6AB02FF", "#A6761DFF", "#666666FF"), ) penguins |> gg_point( x = flipper_length_mm, y = body_mass_g, ) + geom_vline(xintercept = 200) + annotate("text", x = I(0.25), y = I(0.75), label = "Here") penguins |> gg_histogram( x = flipper_length_mm, col = species, ) + geom_vline(xintercept = 200) + annotate("text", x = I(0.75), y = I(0.75), label = "Here")
library(ggplot2) library(ggblanket) library(palmerpenguins) set_blanket( mode = dark_mode_r(), colour = "#E7298AFF", text_colour = darkness[1], reference_line_colour = darkness[1], col_palette_d = c("#1B9E77FF", "#D95F02FF", "#7570b3FF", "#E7298AFF", "#66A61EFF", "#E6AB02FF", "#A6761DFF", "#666666FF"), ) penguins |> gg_point( x = flipper_length_mm, y = body_mass_g, ) + geom_vline(xintercept = 200) + annotate("text", x = I(0.25), y = I(0.75), label = "Here") penguins |> gg_histogram( x = flipper_length_mm, col = species, ) + geom_vline(xintercept = 200) + annotate("text", x = I(0.75), y = I(0.75), label = "Here")
Set a discrete colour and fill palettes
weave_col_palettes( 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_palettes( 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", ... )
col_palette_d |
For a discrete scale, a character vector of hex codes. Use NULL for ggplot2 default. |
col_palette_c |
For a continuous scale, a character vector of hex codes. Use NULL for ggplot2 default. |
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. |
... |
Dots to support trailing commas etc. |
Update the colour/fill geom default, and update other defaults for text and reference line geoms.
ggplot2::update_geom_defaults()
can be used to further fine-tune geom defaults.
weave_geom_defaults( colour = "#357BA2FF", fill = colour, text_colour = "#121B24FF", text_size = 11/2.835052, text_family = "", reference_line_colour = "#121B24FF", reference_line_linewidth = 0.33 )
weave_geom_defaults( colour = "#357BA2FF", fill = colour, text_colour = "#121B24FF", text_size = 11/2.835052, text_family = "", reference_line_colour = "#121B24FF", reference_line_linewidth = 0.33 )
colour |
A default hex colour for the colour of geoms (other than text or reference line geoms). |
fill |
A default hex colour for the fill of geoms (other than text or reference line geoms). |
text_colour |
A default hex colour for the colour (and fill) of the "text" and "label" geoms. |
text_size |
A default size for the "text" and "label" geoms. |
text_family |
A default family for the "text" and "label" geoms. |
reference_line_colour |
A default hex colour for the colour of the "hline", "vline", "abline" and "curve" geoms. |
reference_line_linewidth |
A default linewidth for the the "hline", "vline", "abline" and "curve" geoms. |
Set a mode for the mode argument in gg_*
functions.
weave_mode(mode = light_mode_r())
weave_mode(mode = light_mode_r())
mode |
A ggplot2 theme (e.g. |
Set a theme to be +
-ed on unmodified to gg_*
functions. Note, the mode
takes precedence, unless the set/weaved mode is mode = NULL
.
weave_theme(theme = light_mode_r() + mode_orientation_to_x())
weave_theme(theme = light_mode_r() + mode_orientation_to_x())
theme |
A ggplot2 theme that the |