From 9ec8feefa155ce7f8aea57190562cf870b18f5c1 Mon Sep 17 00:00:00 2001 From: Hiroaki Yutani Date: Mon, 25 Nov 2019 03:12:09 +0900 Subject: [PATCH 1/4] Update visual cases (#3638) --- .../one-combined-colorbar-for-colour-and-fill-aesthetics.svg | 2 +- ...red-gradient-colorbar-thick-black-tick-marks-green-frame.svg | 2 +- ...white-to-red-gradient-colorbar-white-tick-marks-no-frame.svg | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/figs/guides/one-combined-colorbar-for-colour-and-fill-aesthetics.svg b/tests/figs/guides/one-combined-colorbar-for-colour-and-fill-aesthetics.svg index e8e61da7ec..1965e13fa8 100644 --- a/tests/figs/guides/one-combined-colorbar-for-colour-and-fill-aesthetics.svg +++ b/tests/figs/guides/one-combined-colorbar-for-colour-and-fill-aesthetics.svg @@ -51,7 +51,7 @@ x y - + 1 2 3 diff --git a/tests/figs/guides/white-to-red-gradient-colorbar-thick-black-tick-marks-green-frame.svg b/tests/figs/guides/white-to-red-gradient-colorbar-thick-black-tick-marks-green-frame.svg index b7e852bba4..5ba8cfc8d6 100644 --- a/tests/figs/guides/white-to-red-gradient-colorbar-thick-black-tick-marks-green-frame.svg +++ b/tests/figs/guides/white-to-red-gradient-colorbar-thick-black-tick-marks-green-frame.svg @@ -51,7 +51,7 @@ x x - + 0.0 0.5 diff --git a/tests/figs/guides/white-to-red-gradient-colorbar-white-tick-marks-no-frame.svg b/tests/figs/guides/white-to-red-gradient-colorbar-white-tick-marks-no-frame.svg index cb60f013aa..7b25664f0b 100644 --- a/tests/figs/guides/white-to-red-gradient-colorbar-white-tick-marks-no-frame.svg +++ b/tests/figs/guides/white-to-red-gradient-colorbar-white-tick-marks-no-frame.svg @@ -51,7 +51,7 @@ x x - + 0.0 0.5 1.0 From 5dfe49829d9b0b35f9cf0783d9915c6112f88eec Mon Sep 17 00:00:00 2001 From: Hadley Wickham Date: Mon, 25 Nov 2019 07:56:05 +1300 Subject: [PATCH 2/4] Upgrade to roxygen2 7.0.1 (#3637) Including converting all uses of `\%` back to `%`, and removing roxygen2 tags that the new warnings indicated were superfluous. --- DESCRIPTION | 2 +- R/geom-bar.r | 2 +- R/geom-boxplot.r | 2 +- R/geom-rug.r | 4 +- R/layer.r | 1 - R/plot-construction.r | 2 +- R/position-dodge.r | 1 - R/position-jitter.r | 4 +- R/position-jitterdodge.R | 2 +- R/scale-.r | 4 +- R/scale-steps.R | 4 - R/stat-boxplot.r | 6 +- R/theme-current.R | 6 +- R/theme.r | 2 +- man/absoluteGrob.Rd | 10 ++- man/annotate.Rd | 18 ++++- man/annotation_custom.Rd | 3 +- man/annotation_logticks.Rd | 18 ++++- man/as.list.ggproto.Rd | 11 +-- man/bidirection.Rd | 12 ++- man/binned_scale.Rd | 29 +++++-- man/borders.Rd | 34 +++++--- man/continuous_scale.Rd | 27 +++++-- man/coord_cartesian.Rd | 9 ++- man/coord_fixed.Rd | 3 +- man/coord_map.Rd | 16 ++-- man/coord_trans.Rd | 13 ++- man/cut_interval.Rd | 27 ++++--- man/discrete_scale.Rd | 21 +++-- man/draw_key.Rd | 2 +- man/element.Rd | 40 ++++++--- man/facet_grid.Rd | 17 +++- man/facet_wrap.Rd | 16 +++- man/fortify.sp.Rd | 3 +- man/geom_abline.Rd | 35 ++++++-- man/geom_bar.Rd | 49 ++++++++--- man/geom_bin2d.Rd | 31 +++++-- man/geom_blank.Rd | 11 ++- man/geom_boxplot.Rd | 44 +++++++--- man/geom_contour.Rd | 78 +++++++++++++----- man/geom_count.Rd | 28 +++++-- man/geom_density.Rd | 36 +++++++-- man/geom_density_2d.Rd | 37 ++++++--- man/geom_dotplot.Rd | 27 +++++-- man/geom_errorbarh.Rd | 13 ++- man/geom_hex.Rd | 30 +++++-- man/geom_histogram.Rd | 57 +++++++++---- man/geom_jitter.Rd | 15 +++- man/geom_linerange.Rd | 58 ++++++++++--- man/geom_map.Rd | 12 ++- man/geom_path.Rd | 50 +++++++++--- man/geom_point.Rd | 13 ++- man/geom_polygon.Rd | 14 +++- man/geom_qq.Rd | 74 ++++++++++++----- man/geom_quantile.Rd | 37 ++++++--- man/geom_ribbon.Rd | 30 +++++-- man/geom_rug.Rd | 17 +++- man/geom_segment.Rd | 40 ++++++--- man/geom_smooth.Rd | 46 ++++++++--- man/geom_spoke.Rd | 13 ++- man/geom_text.Rd | 41 +++++++--- man/geom_tile.Rd | 49 ++++++++--- man/geom_violin.Rd | 40 ++++++--- man/gg-add.Rd | 2 +- man/ggplot.Rd | 5 +- man/ggplot2-ggproto.Rd | 36 ++++----- man/ggplot2-package.Rd | 2 +- man/ggsave.Rd | 22 +++-- man/ggsf.Rd | 91 +++++++++++++++------ man/ggtheme.Rd | 98 +++++++++++++++------- man/guide_axis.Rd | 10 ++- man/guide_bins.Rd | 41 +++++++--- man/guide_colourbar.Rd | 94 +++++++++++++++------ man/guide_coloursteps.Rd | 67 +++++++-------- man/guide_legend.Rd | 42 +++++++--- man/guides.Rd | 9 ++- man/labeller.Rd | 10 ++- man/labs.Rd | 9 ++- man/layer.Rd | 20 +++-- man/layer_sf.Rd | 15 +++- man/position_dodge.Rd | 19 +++-- man/position_identity.Rd | 11 +-- man/position_jitter.Rd | 11 +-- man/position_jitterdodge.Rd | 19 +++-- man/position_nudge.Rd | 11 +-- man/position_stack.Rd | 11 +-- man/print.ggproto.Rd | 6 +- man/qplot.Rd | 44 ++++++++-- man/reexports.Rd | 2 +- man/remove_missing.Rd | 3 +- man/scale_alpha.Rd | 13 +-- man/scale_binned.Rd | 49 +++++++---- man/scale_brewer.Rd | 96 +++++++++++++++------- man/scale_colour_continuous.Rd | 12 ++- man/scale_continuous.Rd | 55 +++++++++---- man/scale_date.Rd | 135 ++++++++++++++++++++++--------- man/scale_discrete.Rd | 52 +++++------- man/scale_gradient.Rd | 136 ++++++++++++++++++++----------- man/scale_grey.Rd | 66 ++++++++------- man/scale_hue.Rd | 73 ++++++++++------- man/scale_linetype.Rd | 29 +++---- man/scale_manual.Rd | 29 +++---- man/scale_shape.Rd | 31 +++---- man/scale_size.Rd | 114 ++++++++++---------------- man/scale_steps.Rd | 135 ++++++++++++++++++++----------- man/scale_viridis.Rd | 113 +++++++++++++++++++------- man/sec_axis.Rd | 20 +++-- man/stat_ecdf.Rd | 15 +++- man/stat_ellipse.Rd | 17 +++- man/stat_function.Rd | 18 ++++- man/stat_identity.Rd | 11 ++- man/stat_sf_coordinates.Rd | 14 +++- man/stat_summary.Rd | 53 +++++++++--- man/stat_summary_2d.Rd | 40 ++++++--- man/stat_unique.Rd | 13 ++- man/theme.Rd | 144 +++++++++++++++++++++++++-------- man/theme_get.Rd | 6 +- 117 files changed, 2492 insertions(+), 1103 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 6fb30e71f2..20143da6b5 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -253,6 +253,6 @@ Collate: 'zxx.r' 'zzz.r' VignetteBuilder: knitr -RoxygenNote: 6.1.1 +RoxygenNote: 7.0.1 Roxygen: list(markdown = TRUE) Encoding: UTF-8 diff --git a/R/geom-bar.r b/R/geom-bar.r index 4a8309cffe..cff012f926 100644 --- a/R/geom-bar.r +++ b/R/geom-bar.r @@ -35,7 +35,7 @@ #' automatically determines the orientation from the aesthetic mapping. In the #' rare event that this fails it can be given explicitly by setting `orientation` #' to either `"x"` or `"y"`. See the *Orientation* section for more detail. -#' @param width Bar width. By default, set to 90\% of the resolution of the data. +#' @param width Bar width. By default, set to 90% of the resolution of the data. #' @param binwidth `geom_bar()` no longer has a binwidth argument - if #' you use it you'll get an warning telling to you use #' [geom_histogram()] instead. diff --git a/R/geom-boxplot.r b/R/geom-boxplot.r index 8ce8574114..8273a854f8 100644 --- a/R/geom-boxplot.r +++ b/R/geom-boxplot.r @@ -21,7 +21,7 @@ #' individually. #' #' In a notched box plot, the notches extend `1.58 * IQR / sqrt(n)`. -#' This gives a roughly 95\% confidence interval for comparing medians. +#' This gives a roughly 95% confidence interval for comparing medians. #' See McGill et al. (1978) for more details. #' #' @eval rd_aesthetics("geom", "boxplot") diff --git a/R/geom-rug.r b/R/geom-rug.r index 5c226af11e..cbf7cbfe65 100644 --- a/R/geom-rug.r +++ b/R/geom-rug.r @@ -4,9 +4,9 @@ #' with the two 1d marginal distributions. Rug plots display individual #' cases so are best used with smaller datasets. #' -#' By default, the rug lines are drawn with a length that corresponds to 3\% +#' By default, the rug lines are drawn with a length that corresponds to 3% #' of the total plot size. Since the default scale expansion of for continuous -#' variables is 5\% at both ends of the scale, the rug will not overlap with +#' variables is 5% at both ends of the scale, the rug will not overlap with #' any data points under the default settings. #' #' @eval rd_aesthetics("geom", "rug") diff --git a/R/layer.r b/R/layer.r index e2f60a13e5..633fe195a4 100644 --- a/R/layer.r +++ b/R/layer.r @@ -5,7 +5,6 @@ #' calls but it can also be created directly using this function. #' #' @export -#' @inheritParams geom_point #' @param mapping Set of aesthetic mappings created by [aes()] or #' [aes_()]. If specified and `inherit.aes = TRUE` (the #' default), it is combined with the default mapping at the top level of the diff --git a/R/plot-construction.r b/R/plot-construction.r index 8796c0d6d9..7ef9f79ba5 100644 --- a/R/plot-construction.r +++ b/R/plot-construction.r @@ -15,7 +15,7 @@ #' - A `coord` overrides the current coordinate system. #' - A `facet` specification overrides the current faceting. #' -#' To replace the current default data frame, you must use \code{\%+\%}, +#' To replace the current default data frame, you must use `%+%`, #' due to S3 method precedence issues. #' #' You can also supply a list, in which case each element of the list will diff --git a/R/position-dodge.r b/R/position-dodge.r index 4730a7fbf3..e7895c1d56 100644 --- a/R/position-dodge.r +++ b/R/position-dodge.r @@ -6,7 +6,6 @@ #' also works with bars and rectangles. But unlike `position_dodge`, #' `position_dodge2` works without a grouping variable in a layer. #' -#' @inheritParams position_identity #' @param width Dodging width, when different to the width of the individual #' elements. This is useful when you want to align narrow geoms with wider #' geoms. See the examples. diff --git a/R/position-jitter.r b/R/position-jitter.r index 824a30e526..1e314aa2c1 100644 --- a/R/position-jitter.r +++ b/R/position-jitter.r @@ -9,8 +9,8 @@ #' is added in both positive and negative directions, so the total spread #' is twice the value specified here. #' -#' If omitted, defaults to 40\% of the resolution of the data: this means the -#' jitter values will occupy 80\% of the implied bins. Categorical data +#' If omitted, defaults to 40% of the resolution of the data: this means the +#' jitter values will occupy 80% of the implied bins. Categorical data #' is aligned on the integers, so a width or height of 0.5 will spread the #' data so it's not possible to see the distinction between the categories. #' @param seed A random seed to make the jitter reproducible. diff --git a/R/position-jitterdodge.R b/R/position-jitterdodge.R index eba442395c..30685b12ec 100644 --- a/R/position-jitterdodge.R +++ b/R/position-jitterdodge.R @@ -5,7 +5,7 @@ #' a fill aesthetic supplied). #' #' @family position adjustments -#' @param jitter.width degree of jitter in x direction. Defaults to 40\% of the +#' @param jitter.width degree of jitter in x direction. Defaults to 40% of the #' resolution of the data. #' @param jitter.height degree of jitter in y direction. Defaults to 0. #' @param dodge.width the amount to dodge in the x direction. Defaults to 0.75, diff --git a/R/scale-.r b/R/scale-.r index ed5128d9f8..8bd5fd7d2a 100644 --- a/R/scale-.r +++ b/R/scale-.r @@ -75,7 +75,7 @@ #' padding around the data to ensure that they are placed some distance #' away from the axes. Use the convenience function [expansion()] #' to generate the values for the `expand` argument. The defaults are to -#' expand the scale by 5\% on each side for continuous variables, and by +#' expand the scale by 5% on each side for continuous variables, and by #' 0.6 units on each side for discrete variables. #' @param position For position scales, The position of the axis. #' `left` or `right` for y axes, `top` or `bottom` for x axes. @@ -1033,7 +1033,7 @@ ScaleBinned <- ggproto("ScaleBinned", Scale, warning("Ignoring n.breaks. Use a breaks function that supports setting number of breaks", call. = FALSE) } breaks <- self$breaks(limits) - } + } } else { breaks <- self$breaks } diff --git a/R/scale-steps.R b/R/scale-steps.R index d671569754..b5f9df301d 100644 --- a/R/scale-steps.R +++ b/R/scale-steps.R @@ -18,7 +18,6 @@ #' @seealso [scales::seq_gradient_pal()] for details on underlying #' palette #' @family colour scales -#' @rdname scale_steps #' @export #' @examples #' df <- data.frame( @@ -41,10 +40,7 @@ #' ggplot(df, aes(x, y)) + #' geom_point(aes(colour = z1)) + #' scale_colour_stepsn(colours = terrain.colors(10)) -#' - #' @rdname scale_steps -#' @export scale_colour_steps <- function(..., low = "#132B43", high = "#56B1F7", space = "Lab", na.value = "grey50", guide = "coloursteps", aesthetics = "colour") { binned_scale(aesthetics, "steps", seq_gradient_pal(low, high, space), diff --git a/R/stat-boxplot.r b/R/stat-boxplot.r index e9833d1720..8802a0ae36 100644 --- a/R/stat-boxplot.r +++ b/R/stat-boxplot.r @@ -5,11 +5,11 @@ #' \describe{ #' \item{width}{width of boxplot} #' \item{ymin}{lower whisker = smallest observation greater than or equal to lower hinge - 1.5 * IQR} -#' \item{lower}{lower hinge, 25\% quantile} +#' \item{lower}{lower hinge, 25% quantile} #' \item{notchlower}{lower edge of notch = median - 1.58 * IQR / sqrt(n)} -#' \item{middle}{median, 50\% quantile} +#' \item{middle}{median, 50% quantile} #' \item{notchupper}{upper edge of notch = median + 1.58 * IQR / sqrt(n)} -#' \item{upper}{upper hinge, 75\% quantile} +#' \item{upper}{upper hinge, 75% quantile} #' \item{ymax}{upper whisker = largest observation less than or equal to upper hinge + 1.5 * IQR} #' } #' @export diff --git a/R/theme-current.R b/R/theme-current.R index 8cfb61f87e..58adaf49fc 100644 --- a/R/theme-current.R +++ b/R/theme-current.R @@ -11,19 +11,19 @@ NULL #' #' @section Adding on to a theme: #' -#' `+` and \code{\%+replace\%} can be used to modify elements in themes. +#' `+` and `%+replace%` can be used to modify elements in themes. #' #' `+` updates the elements of e1 that differ from elements specified (not #' NULL) in e2. Thus this operator can be used to incrementally add or modify #' attributes of a ggplot theme. #' -#' In contrast, \code{\%+replace\%} replaces the entire element; any element of +#' In contrast, `%+replace%` replaces the entire element; any element of #' a theme not specified in e2 will not be present in the resulting theme (i.e. #' NULL). Thus this operator can be used to overwrite an entire theme. #' #' `theme_update` uses the `+` operator, so that any unspecified #' values in the theme element will default to the values they are set in the -#' theme. `theme_replace` uses \code{\%+replace\%} to completely replace +#' theme. `theme_replace` uses `%+replace%` to completely replace #' the element, so any unspecified values will overwrite the current value in #' the theme with `NULL`s. #' diff --git a/R/theme.r b/R/theme.r index 0ef578b26c..d710cfaea1 100644 --- a/R/theme.r +++ b/R/theme.r @@ -170,7 +170,7 @@ #' [`el_def()`]. See [`el_def()`] for more details. #' #' @seealso -#' [+.gg()] and \code{\link{\%+replace\%}}, +#' [+.gg()] and [%+replace%], #' [element_blank()], [element_line()], #' [element_rect()], and [element_text()] for #' details of the specific theme elements. diff --git a/man/absoluteGrob.Rd b/man/absoluteGrob.Rd index f6bcc2ee6f..cdc3c1e072 100644 --- a/man/absoluteGrob.Rd +++ b/man/absoluteGrob.Rd @@ -4,8 +4,14 @@ \alias{absoluteGrob} \title{Absolute grob} \usage{ -absoluteGrob(grob, width = NULL, height = NULL, xmin = NULL, - ymin = NULL, vp = NULL) +absoluteGrob( + grob, + width = NULL, + height = NULL, + xmin = NULL, + ymin = NULL, + vp = NULL +) } \description{ This grob has fixed dimensions and position. diff --git a/man/annotate.Rd b/man/annotate.Rd index 6a3163026b..3e6862dcf3 100644 --- a/man/annotate.Rd +++ b/man/annotate.Rd @@ -4,9 +4,19 @@ \alias{annotate} \title{Create an annotation layer} \usage{ -annotate(geom, x = NULL, y = NULL, xmin = NULL, xmax = NULL, - ymin = NULL, ymax = NULL, xend = NULL, yend = NULL, ..., - na.rm = FALSE) +annotate( + geom, + x = NULL, + y = NULL, + xmin = NULL, + xmax = NULL, + ymin = NULL, + ymax = NULL, + xend = NULL, + yend = NULL, + ..., + na.rm = FALSE +) } \arguments{ \item{geom}{name of geom to use for annotation} @@ -51,5 +61,5 @@ p + annotate("text", x = 2:3, y = 20:21, label = c("my label", "label 2")) p + annotate("text", x = 4, y = 25, label = "italic(R) ^ 2 == 0.75", parse = TRUE) p + annotate("text", x = 4, y = 25, - label = "paste(italic(R) ^ 2, \\" = .75\\")", parse = TRUE) + label = "paste(italic(R) ^ 2, \" = .75\")", parse = TRUE) } diff --git a/man/annotation_custom.Rd b/man/annotation_custom.Rd index 328dc18488..a531f6bac0 100644 --- a/man/annotation_custom.Rd +++ b/man/annotation_custom.Rd @@ -4,8 +4,7 @@ \alias{annotation_custom} \title{Annotation: Custom grob} \usage{ -annotation_custom(grob, xmin = -Inf, xmax = Inf, ymin = -Inf, - ymax = Inf) +annotation_custom(grob, xmin = -Inf, xmax = Inf, ymin = -Inf, ymax = Inf) } \arguments{ \item{grob}{grob to display} diff --git a/man/annotation_logticks.Rd b/man/annotation_logticks.Rd index 270feae107..426ce7d9d2 100644 --- a/man/annotation_logticks.Rd +++ b/man/annotation_logticks.Rd @@ -4,10 +4,20 @@ \alias{annotation_logticks} \title{Annotation: log tick marks} \usage{ -annotation_logticks(base = 10, sides = "bl", scaled = TRUE, - short = unit(0.1, "cm"), mid = unit(0.2, "cm"), long = unit(0.3, - "cm"), colour = "black", size = 0.5, linetype = 1, alpha = 1, - color = NULL, ...) +annotation_logticks( + base = 10, + sides = "bl", + scaled = TRUE, + short = unit(0.1, "cm"), + mid = unit(0.2, "cm"), + long = unit(0.3, "cm"), + colour = "black", + size = 0.5, + linetype = 1, + alpha = 1, + color = NULL, + ... +) } \arguments{ \item{base}{the base of the log (default 10)} diff --git a/man/as.list.ggproto.Rd b/man/as.list.ggproto.Rd index 7b564516dc..eaeb828751 100644 --- a/man/as.list.ggproto.Rd +++ b/man/as.list.ggproto.Rd @@ -12,14 +12,15 @@ \item{inherit}{If \code{TRUE} (the default), flatten all inherited items into the returned list. If \code{FALSE}, do not include any inherited items.} -\item{...}{Arguments passed on to \code{base::as.list.environment} -\describe{ - \item{all.names}{a logical indicating whether to copy all values or +\item{...}{ + Arguments passed on to \code{\link[base:as.list.environment]{base::as.list.environment}} + \describe{ + \item{\code{all.names}}{a logical indicating whether to copy all values or (default) only those whose names do not begin with a dot.} - \item{sorted}{a logical indicating whether the \code{\link{names}} of + \item{\code{sorted}}{a logical indicating whether the \code{\link[base]{names}} of the resulting list should be sorted (increasingly). Note that this is somewhat costly, but may be useful for comparison of environments.} -}} + }} } \description{ This will not include the object's \code{super} member. diff --git a/man/bidirection.Rd b/man/bidirection.Rd index 1542f5780a..b300b77646 100644 --- a/man/bidirection.Rd +++ b/man/bidirection.Rd @@ -7,9 +7,15 @@ \alias{flipped_names} \title{Utilities for working with bidirecitonal layers} \usage{ -has_flipped_aes(data, params = list(), main_is_orthogonal = NA, - range_is_orthogonal = NA, group_has_equal = FALSE, - ambiguous = FALSE, main_is_continuous = FALSE) +has_flipped_aes( + data, + params = list(), + main_is_orthogonal = NA, + range_is_orthogonal = NA, + group_has_equal = FALSE, + ambiguous = FALSE, + main_is_continuous = FALSE +) flip_data(data, flip = NULL) diff --git a/man/binned_scale.Rd b/man/binned_scale.Rd index 0da32bd185..74c39af560 100644 --- a/man/binned_scale.Rd +++ b/man/binned_scale.Rd @@ -4,12 +4,27 @@ \alias{binned_scale} \title{Binning scale constructor} \usage{ -binned_scale(aesthetics, scale_name, palette, name = waiver(), - breaks = waiver(), labels = waiver(), limits = NULL, - rescaler = rescale, oob = squish, expand = waiver(), - na.value = NA_real_, n.breaks = NULL, nice.breaks = TRUE, - right = TRUE, trans = "identity", show.limits = FALSE, - guide = "bins", position = "left", super = ScaleBinned) +binned_scale( + aesthetics, + scale_name, + palette, + name = waiver(), + breaks = waiver(), + labels = waiver(), + limits = NULL, + rescaler = rescale, + oob = squish, + expand = waiver(), + na.value = NA_real_, + n.breaks = NULL, + nice.breaks = TRUE, + right = TRUE, + trans = "identity", + show.limits = FALSE, + guide = "bins", + position = "left", + super = ScaleBinned +) } \arguments{ \item{aesthetics}{The names of the aesthetics that this scale works with.} @@ -103,7 +118,7 @@ or the object itself. Built-in transformations include "asn", "atanh", A transformation object bundles together a transform, its inverse, and methods for generating breaks and labels. Transformation objects -are defined in the scales package, and are called \code{_trans} (e.g., +are defined in the scales package, and are called \verb{_trans} (e.g., \code{\link[scales:boxcox_trans]{scales::boxcox_trans()}}). You can create your own transformation with \code{\link[scales:trans_new]{scales::trans_new()}}.} diff --git a/man/borders.Rd b/man/borders.Rd index 076d3b9df6..0bac0cfe82 100644 --- a/man/borders.Rd +++ b/man/borders.Rd @@ -4,8 +4,15 @@ \alias{borders} \title{Create a layer of map borders} \usage{ -borders(database = "world", regions = ".", fill = NA, - colour = "grey50", xlim = NULL, ylim = NULL, ...) +borders( + database = "world", + regions = ".", + fill = NA, + colour = "grey50", + xlim = NULL, + ylim = NULL, + ... +) } \arguments{ \item{database}{map data, see \code{\link[maps:map]{maps::map()}} for details} @@ -19,17 +26,18 @@ borders(database = "world", regions = ".", fill = NA, \item{xlim, ylim}{latitudinal and longitudinal ranges for extracting map polygons, see \code{\link[maps:map]{maps::map()}} for details.} -\item{...}{Arguments passed on to \code{geom_polygon} -\describe{ - \item{rule}{Either \code{"evenodd"} or \code{"winding"}. If polygons with holes are +\item{...}{ + Arguments passed on to \code{\link[=geom_polygon]{geom_polygon}} + \describe{ + \item{\code{rule}}{Either \code{"evenodd"} or \code{"winding"}. If polygons with holes are being drawn (using the \code{subgroup} aesthetic) this argument defines how the hole coordinates are interpreted. See the examples in \code{\link[grid:pathGrob]{grid::pathGrob()}} for an explanation.} - \item{mapping}{Set of aesthetic mappings created by \code{\link[=aes]{aes()}} or + \item{\code{mapping}}{Set of aesthetic mappings created by \code{\link[=aes]{aes()}} or \code{\link[=aes_]{aes_()}}. If specified and \code{inherit.aes = TRUE} (the default), it is combined with the default mapping at the top level of the plot. You must supply \code{mapping} if there is no plot mapping.} - \item{data}{The data to be displayed in this layer. There are three + \item{\code{data}}{The data to be displayed in this layer. There are three options: If \code{NULL}, the default, the data is inherited from the plot @@ -43,22 +51,22 @@ A \code{function} will be called with a single argument, the plot data. The return value must be a \code{data.frame}, and will be used as the layer data. A \code{function} can be created from a \code{formula} (e.g. \code{~ head(.x, 10)}).} - \item{stat}{The statistical transformation to use on the data for this + \item{\code{stat}}{The statistical transformation to use on the data for this layer, as a string.} - \item{position}{Position adjustment, either as a string, or the result of + \item{\code{position}}{Position adjustment, either as a string, or the result of a call to a position adjustment function.} - \item{show.legend}{logical. Should this layer be included in the legends? + \item{\code{show.legend}}{logical. Should this layer be included in the legends? \code{NA}, the default, includes if any aesthetics are mapped. \code{FALSE} never includes, and \code{TRUE} always includes. It can also be a named logical vector to finely select the aesthetics to display.} - \item{inherit.aes}{If \code{FALSE}, overrides the default aesthetics, + \item{\code{inherit.aes}}{If \code{FALSE}, overrides the default aesthetics, rather than combining with them. This is most useful for helper functions that define both data and aesthetics and shouldn't inherit behaviour from the default plot specification, e.g. \code{\link[=borders]{borders()}}.} - \item{na.rm}{If \code{FALSE}, the default, missing values are removed with + \item{\code{na.rm}}{If \code{FALSE}, the default, missing values are removed with a warning. If \code{TRUE}, missing values are silently removed.} -}} + }} } \description{ This is a quick and dirty way to get map data (from the maps package) diff --git a/man/continuous_scale.Rd b/man/continuous_scale.Rd index e47020117c..2ea6a4843f 100644 --- a/man/continuous_scale.Rd +++ b/man/continuous_scale.Rd @@ -4,12 +4,25 @@ \alias{continuous_scale} \title{Continuous scale constructor} \usage{ -continuous_scale(aesthetics, scale_name, palette, name = waiver(), - breaks = waiver(), minor_breaks = waiver(), n.breaks = NULL, - labels = waiver(), limits = NULL, rescaler = rescale, - oob = censor, expand = waiver(), na.value = NA_real_, - trans = "identity", guide = "legend", position = "left", - super = ScaleContinuous) +continuous_scale( + aesthetics, + scale_name, + palette, + name = waiver(), + breaks = waiver(), + minor_breaks = waiver(), + n.breaks = NULL, + labels = waiver(), + limits = NULL, + rescaler = rescale, + oob = censor, + expand = waiver(), + na.value = NA_real_, + trans = "identity", + guide = "legend", + position = "left", + super = ScaleContinuous +) } \arguments{ \item{aesthetics}{The names of the aesthetics that this scale works with.} @@ -105,7 +118,7 @@ or the object itself. Built-in transformations include "asn", "atanh", A transformation object bundles together a transform, its inverse, and methods for generating breaks and labels. Transformation objects -are defined in the scales package, and are called \code{_trans} (e.g., +are defined in the scales package, and are called \verb{_trans} (e.g., \code{\link[scales:boxcox_trans]{scales::boxcox_trans()}}). You can create your own transformation with \code{\link[scales:trans_new]{scales::trans_new()}}.} diff --git a/man/coord_cartesian.Rd b/man/coord_cartesian.Rd index f5328844e3..99c13466fa 100644 --- a/man/coord_cartesian.Rd +++ b/man/coord_cartesian.Rd @@ -4,8 +4,13 @@ \alias{coord_cartesian} \title{Cartesian coordinates} \usage{ -coord_cartesian(xlim = NULL, ylim = NULL, expand = TRUE, - default = FALSE, clip = "on") +coord_cartesian( + xlim = NULL, + ylim = NULL, + expand = TRUE, + default = FALSE, + clip = "on" +) } \arguments{ \item{xlim, ylim}{Limits for the x and y axes.} diff --git a/man/coord_fixed.Rd b/man/coord_fixed.Rd index abf5e6b8f0..50eea13ac5 100644 --- a/man/coord_fixed.Rd +++ b/man/coord_fixed.Rd @@ -5,8 +5,7 @@ \alias{coord_equal} \title{Cartesian coordinates with fixed "aspect ratio"} \usage{ -coord_fixed(ratio = 1, xlim = NULL, ylim = NULL, expand = TRUE, - clip = "on") +coord_fixed(ratio = 1, xlim = NULL, ylim = NULL, expand = TRUE, clip = "on") } \arguments{ \item{ratio}{aspect ratio, expressed as \code{y / x}} diff --git a/man/coord_map.Rd b/man/coord_map.Rd index bb72d3dcd4..3eab570b20 100644 --- a/man/coord_map.Rd +++ b/man/coord_map.Rd @@ -5,11 +5,17 @@ \alias{coord_quickmap} \title{Map projections} \usage{ -coord_map(projection = "mercator", ..., parameters = NULL, - orientation = NULL, xlim = NULL, ylim = NULL, clip = "on") - -coord_quickmap(xlim = NULL, ylim = NULL, expand = TRUE, - clip = "on") +coord_map( + projection = "mercator", + ..., + parameters = NULL, + orientation = NULL, + xlim = NULL, + ylim = NULL, + clip = "on" +) + +coord_quickmap(xlim = NULL, ylim = NULL, expand = TRUE, clip = "on") } \arguments{ \item{projection}{projection to use, see diff --git a/man/coord_trans.Rd b/man/coord_trans.Rd index d109704ae5..04d8a74134 100644 --- a/man/coord_trans.Rd +++ b/man/coord_trans.Rd @@ -4,9 +4,16 @@ \alias{coord_trans} \title{Transformed Cartesian coordinate system} \usage{ -coord_trans(x = "identity", y = "identity", xlim = NULL, - ylim = NULL, limx = "DEPRECATED", limy = "DEPRECATED", - clip = "on", expand = TRUE) +coord_trans( + x = "identity", + y = "identity", + xlim = NULL, + ylim = NULL, + limx = "DEPRECATED", + limy = "DEPRECATED", + clip = "on", + expand = TRUE +) } \arguments{ \item{x, y}{Transformers for x and y axes or their names.} diff --git a/man/cut_interval.Rd b/man/cut_interval.Rd index d7a20c5f97..259e20043f 100644 --- a/man/cut_interval.Rd +++ b/man/cut_interval.Rd @@ -10,8 +10,14 @@ cut_interval(x, n = NULL, length = NULL, ...) cut_number(x, n = NULL, ...) -cut_width(x, width, center = NULL, boundary = NULL, - closed = c("right", "left"), ...) +cut_width( + x, + width, + center = NULL, + boundary = NULL, + closed = c("right", "left"), + ... +) } \arguments{ \item{x}{numeric vector} @@ -20,21 +26,22 @@ cut_width(x, width, center = NULL, boundary = NULL, \item{length}{length of each interval} -\item{...}{Arguments passed on to \code{base::cut.default} -\describe{ - \item{breaks}{either a numeric vector of two or more unique cut points or a +\item{...}{ + Arguments passed on to \code{\link[base:cut.default]{base::cut.default}} + \describe{ + \item{\code{breaks}}{either a numeric vector of two or more unique cut points or a single number (greater than or equal to 2) giving the number of intervals into which \code{x} is to be cut.} - \item{labels}{labels for the levels of the resulting category. By default, + \item{\code{labels}}{labels for the levels of the resulting category. By default, labels are constructed using \code{"(a,b]"} interval notation. If \code{labels = FALSE}, simple integer codes are returned instead of a factor.} - \item{right}{logical, indicating if the intervals should be closed on + \item{\code{right}}{logical, indicating if the intervals should be closed on the right (and open on the left) or vice versa.} - \item{dig.lab}{integer which is used when labels are not given. It + \item{\code{dig.lab}}{integer which is used when labels are not given. It determines the number of digits used in formatting the break numbers.} - \item{ordered_result}{logical: should the result be an ordered factor?} -}} + \item{\code{ordered_result}}{logical: should the result be an ordered factor?} + }} \item{width}{The bin width.} diff --git a/man/discrete_scale.Rd b/man/discrete_scale.Rd index 0aabfe02b1..923f10672d 100644 --- a/man/discrete_scale.Rd +++ b/man/discrete_scale.Rd @@ -4,11 +4,22 @@ \alias{discrete_scale} \title{Discrete scale constructor} \usage{ -discrete_scale(aesthetics, scale_name, palette, name = waiver(), - breaks = waiver(), labels = waiver(), limits = NULL, - expand = waiver(), na.translate = TRUE, na.value = NA, - drop = TRUE, guide = "legend", position = "left", - super = ScaleDiscrete) +discrete_scale( + aesthetics, + scale_name, + palette, + name = waiver(), + breaks = waiver(), + labels = waiver(), + limits = NULL, + expand = waiver(), + na.translate = TRUE, + na.value = NA, + drop = TRUE, + guide = "legend", + position = "left", + super = ScaleDiscrete +) } \arguments{ \item{aesthetics}{The names of the aesthetics that this scale works with.} diff --git a/man/draw_key.Rd b/man/draw_key.Rd index 3b8edcf46d..302855aced 100644 --- a/man/draw_key.Rd +++ b/man/draw_key.Rd @@ -65,7 +65,7 @@ A grid grob. } \description{ Each geom has an associated function that draws the key when the geom needs -to be displayed in a legend. These functions are called \code{draw_key_*()}, where +to be displayed in a legend. These functions are called \verb{draw_key_*()}, where \code{*} stands for the name of the respective key glyph. The key glyphs can be customized for individual geoms by providing a geom with the \code{key_glyph} argument (see \code{\link[=layer]{layer()}} or examples below.) diff --git a/man/element.Rd b/man/element.Rd index 286ae88dc4..7dea47eadb 100644 --- a/man/element.Rd +++ b/man/element.Rd @@ -13,17 +13,39 @@ margin(t = 0, r = 0, b = 0, l = 0, unit = "pt") element_blank() -element_rect(fill = NULL, colour = NULL, size = NULL, - linetype = NULL, color = NULL, inherit.blank = FALSE) +element_rect( + fill = NULL, + colour = NULL, + size = NULL, + linetype = NULL, + color = NULL, + inherit.blank = FALSE +) -element_line(colour = NULL, size = NULL, linetype = NULL, - lineend = NULL, color = NULL, arrow = NULL, - inherit.blank = FALSE) +element_line( + colour = NULL, + size = NULL, + linetype = NULL, + lineend = NULL, + color = NULL, + arrow = NULL, + inherit.blank = FALSE +) -element_text(family = NULL, face = NULL, colour = NULL, - size = NULL, hjust = NULL, vjust = NULL, angle = NULL, - lineheight = NULL, color = NULL, margin = NULL, debug = NULL, - inherit.blank = FALSE) +element_text( + family = NULL, + face = NULL, + colour = NULL, + size = NULL, + hjust = NULL, + vjust = NULL, + angle = NULL, + lineheight = NULL, + color = NULL, + margin = NULL, + debug = NULL, + inherit.blank = FALSE +) rel(x) } diff --git a/man/facet_grid.Rd b/man/facet_grid.Rd index b711eb1929..c05507811b 100644 --- a/man/facet_grid.Rd +++ b/man/facet_grid.Rd @@ -4,10 +4,19 @@ \alias{facet_grid} \title{Lay out panels in a grid} \usage{ -facet_grid(rows = NULL, cols = NULL, scales = "fixed", - space = "fixed", shrink = TRUE, labeller = "label_value", - as.table = TRUE, switch = NULL, drop = TRUE, margins = FALSE, - facets = NULL) +facet_grid( + rows = NULL, + cols = NULL, + scales = "fixed", + space = "fixed", + shrink = TRUE, + labeller = "label_value", + as.table = TRUE, + switch = NULL, + drop = TRUE, + margins = FALSE, + facets = NULL +) } \arguments{ \item{rows, cols}{A set of variables or expressions quoted by diff --git a/man/facet_wrap.Rd b/man/facet_wrap.Rd index d6c3075988..186043579a 100644 --- a/man/facet_wrap.Rd +++ b/man/facet_wrap.Rd @@ -4,9 +4,19 @@ \alias{facet_wrap} \title{Wrap a 1d ribbon of panels into 2d} \usage{ -facet_wrap(facets, nrow = NULL, ncol = NULL, scales = "fixed", - shrink = TRUE, labeller = "label_value", as.table = TRUE, - switch = NULL, drop = TRUE, dir = "h", strip.position = "top") +facet_wrap( + facets, + nrow = NULL, + ncol = NULL, + scales = "fixed", + shrink = TRUE, + labeller = "label_value", + as.table = TRUE, + switch = NULL, + drop = TRUE, + dir = "h", + strip.position = "top" +) } \arguments{ \item{facets}{A set of variables or expressions quoted by \code{\link[=vars]{vars()}} diff --git a/man/fortify.sp.Rd b/man/fortify.sp.Rd index 999fb6c1f1..96a638e4cb 100644 --- a/man/fortify.sp.Rd +++ b/man/fortify.sp.Rd @@ -11,8 +11,7 @@ \alias{fortify.Line} \title{Fortify method for classes from the sp package.} \usage{ -\method{fortify}{SpatialPolygonsDataFrame}(model, data, region = NULL, - ...) +\method{fortify}{SpatialPolygonsDataFrame}(model, data, region = NULL, ...) \method{fortify}{SpatialPolygons}(model, data, ...) diff --git a/man/geom_abline.Rd b/man/geom_abline.Rd index cc40e3c6f0..d018b98860 100644 --- a/man/geom_abline.Rd +++ b/man/geom_abline.Rd @@ -6,14 +6,33 @@ \alias{geom_vline} \title{Reference lines: horizontal, vertical, and diagonal} \usage{ -geom_abline(mapping = NULL, data = NULL, ..., slope, intercept, - na.rm = FALSE, show.legend = NA) - -geom_hline(mapping = NULL, data = NULL, ..., yintercept, - na.rm = FALSE, show.legend = NA) - -geom_vline(mapping = NULL, data = NULL, ..., xintercept, - na.rm = FALSE, show.legend = NA) +geom_abline( + mapping = NULL, + data = NULL, + ..., + slope, + intercept, + na.rm = FALSE, + show.legend = NA +) + +geom_hline( + mapping = NULL, + data = NULL, + ..., + yintercept, + na.rm = FALSE, + show.legend = NA +) + +geom_vline( + mapping = NULL, + data = NULL, + ..., + xintercept, + na.rm = FALSE, + show.legend = NA +) } \arguments{ \item{mapping}{Set of aesthetic mappings created by \code{\link[=aes]{aes()}} or \code{\link[=aes_]{aes_()}}.} diff --git a/man/geom_bar.Rd b/man/geom_bar.Rd index aa3d2737e8..c0b33c7fde 100644 --- a/man/geom_bar.Rd +++ b/man/geom_bar.Rd @@ -6,18 +6,43 @@ \alias{stat_count} \title{Bar charts} \usage{ -geom_bar(mapping = NULL, data = NULL, stat = "count", - position = "stack", ..., width = NULL, binwidth = NULL, - na.rm = FALSE, orientation = NA, show.legend = NA, - inherit.aes = TRUE) - -geom_col(mapping = NULL, data = NULL, position = "stack", ..., - width = NULL, na.rm = FALSE, show.legend = NA, - inherit.aes = TRUE) - -stat_count(mapping = NULL, data = NULL, geom = "bar", - position = "stack", ..., width = NULL, na.rm = FALSE, - orientation = NA, show.legend = NA, inherit.aes = TRUE) +geom_bar( + mapping = NULL, + data = NULL, + stat = "count", + position = "stack", + ..., + width = NULL, + binwidth = NULL, + na.rm = FALSE, + orientation = NA, + show.legend = NA, + inherit.aes = TRUE +) + +geom_col( + mapping = NULL, + data = NULL, + position = "stack", + ..., + width = NULL, + na.rm = FALSE, + show.legend = NA, + inherit.aes = TRUE +) + +stat_count( + mapping = NULL, + data = NULL, + geom = "bar", + position = "stack", + ..., + width = NULL, + na.rm = FALSE, + orientation = NA, + show.legend = NA, + inherit.aes = TRUE +) } \arguments{ \item{mapping}{Set of aesthetic mappings created by \code{\link[=aes]{aes()}} or diff --git a/man/geom_bin2d.Rd b/man/geom_bin2d.Rd index 1f879f8cfe..d3912ecf11 100644 --- a/man/geom_bin2d.Rd +++ b/man/geom_bin2d.Rd @@ -6,13 +6,30 @@ \alias{stat_bin2d} \title{Heatmap of 2d bin counts} \usage{ -geom_bin2d(mapping = NULL, data = NULL, stat = "bin2d", - position = "identity", ..., na.rm = FALSE, show.legend = NA, - inherit.aes = TRUE) - -stat_bin_2d(mapping = NULL, data = NULL, geom = "tile", - position = "identity", ..., bins = 30, binwidth = NULL, - drop = TRUE, na.rm = FALSE, show.legend = NA, inherit.aes = TRUE) +geom_bin2d( + mapping = NULL, + data = NULL, + stat = "bin2d", + position = "identity", + ..., + na.rm = FALSE, + show.legend = NA, + inherit.aes = TRUE +) + +stat_bin_2d( + mapping = NULL, + data = NULL, + geom = "tile", + position = "identity", + ..., + bins = 30, + binwidth = NULL, + drop = TRUE, + na.rm = FALSE, + show.legend = NA, + inherit.aes = TRUE +) } \arguments{ \item{mapping}{Set of aesthetic mappings created by \code{\link[=aes]{aes()}} or diff --git a/man/geom_blank.Rd b/man/geom_blank.Rd index ce4101334f..48ccd02801 100644 --- a/man/geom_blank.Rd +++ b/man/geom_blank.Rd @@ -4,8 +4,15 @@ \alias{geom_blank} \title{Draw nothing} \usage{ -geom_blank(mapping = NULL, data = NULL, stat = "identity", - position = "identity", ..., show.legend = NA, inherit.aes = TRUE) +geom_blank( + mapping = NULL, + data = NULL, + stat = "identity", + position = "identity", + ..., + show.legend = NA, + inherit.aes = TRUE +) } \arguments{ \item{mapping}{Set of aesthetic mappings created by \code{\link[=aes]{aes()}} or diff --git a/man/geom_boxplot.Rd b/man/geom_boxplot.Rd index 32d492425c..476ad65f02 100644 --- a/man/geom_boxplot.Rd +++ b/man/geom_boxplot.Rd @@ -5,16 +5,40 @@ \alias{stat_boxplot} \title{A box and whiskers plot (in the style of Tukey)} \usage{ -geom_boxplot(mapping = NULL, data = NULL, stat = "boxplot", - position = "dodge2", ..., outlier.colour = NULL, - outlier.color = NULL, outlier.fill = NULL, outlier.shape = 19, - outlier.size = 1.5, outlier.stroke = 0.5, outlier.alpha = NULL, - notch = FALSE, notchwidth = 0.5, varwidth = FALSE, na.rm = FALSE, - orientation = NA, show.legend = NA, inherit.aes = TRUE) - -stat_boxplot(mapping = NULL, data = NULL, geom = "boxplot", - position = "dodge2", ..., coef = 1.5, na.rm = FALSE, - orientation = NA, show.legend = NA, inherit.aes = TRUE) +geom_boxplot( + mapping = NULL, + data = NULL, + stat = "boxplot", + position = "dodge2", + ..., + outlier.colour = NULL, + outlier.color = NULL, + outlier.fill = NULL, + outlier.shape = 19, + outlier.size = 1.5, + outlier.stroke = 0.5, + outlier.alpha = NULL, + notch = FALSE, + notchwidth = 0.5, + varwidth = FALSE, + na.rm = FALSE, + orientation = NA, + show.legend = NA, + inherit.aes = TRUE +) + +stat_boxplot( + mapping = NULL, + data = NULL, + geom = "boxplot", + position = "dodge2", + ..., + coef = 1.5, + na.rm = FALSE, + orientation = NA, + show.legend = NA, + inherit.aes = TRUE +) } \arguments{ \item{mapping}{Set of aesthetic mappings created by \code{\link[=aes]{aes()}} or diff --git a/man/geom_contour.Rd b/man/geom_contour.Rd index 9c2b89d6f6..c9d30ad028 100644 --- a/man/geom_contour.Rd +++ b/man/geom_contour.Rd @@ -7,26 +7,64 @@ \alias{stat_contour_filled} \title{2d contours of a 3d surface} \usage{ -geom_contour(mapping = NULL, data = NULL, stat = "contour", - position = "identity", ..., bins = NULL, binwidth = NULL, - breaks = NULL, lineend = "butt", linejoin = "round", - linemitre = 10, na.rm = FALSE, show.legend = NA, - inherit.aes = TRUE) - -geom_contour_filled(mapping = NULL, data = NULL, - stat = "contour_filled", position = "identity", ..., bins = NULL, - binwidth = NULL, breaks = NULL, na.rm = FALSE, show.legend = NA, - inherit.aes = TRUE) - -stat_contour(mapping = NULL, data = NULL, geom = "contour", - position = "identity", ..., bins = NULL, binwidth = NULL, - breaks = NULL, na.rm = FALSE, show.legend = NA, - inherit.aes = TRUE) - -stat_contour_filled(mapping = NULL, data = NULL, geom = "polygon", - position = "identity", ..., bins = NULL, binwidth = NULL, - breaks = NULL, na.rm = FALSE, show.legend = NA, - inherit.aes = TRUE) +geom_contour( + mapping = NULL, + data = NULL, + stat = "contour", + position = "identity", + ..., + bins = NULL, + binwidth = NULL, + breaks = NULL, + lineend = "butt", + linejoin = "round", + linemitre = 10, + na.rm = FALSE, + show.legend = NA, + inherit.aes = TRUE +) + +geom_contour_filled( + mapping = NULL, + data = NULL, + stat = "contour_filled", + position = "identity", + ..., + bins = NULL, + binwidth = NULL, + breaks = NULL, + na.rm = FALSE, + show.legend = NA, + inherit.aes = TRUE +) + +stat_contour( + mapping = NULL, + data = NULL, + geom = "contour", + position = "identity", + ..., + bins = NULL, + binwidth = NULL, + breaks = NULL, + na.rm = FALSE, + show.legend = NA, + inherit.aes = TRUE +) + +stat_contour_filled( + mapping = NULL, + data = NULL, + geom = "polygon", + position = "identity", + ..., + bins = NULL, + binwidth = NULL, + breaks = NULL, + na.rm = FALSE, + show.legend = NA, + inherit.aes = TRUE +) } \arguments{ \item{mapping}{Set of aesthetic mappings created by \code{\link[=aes]{aes()}} or diff --git a/man/geom_count.Rd b/man/geom_count.Rd index 4cd241c28d..9e945185c1 100644 --- a/man/geom_count.Rd +++ b/man/geom_count.Rd @@ -5,13 +5,27 @@ \alias{stat_sum} \title{Count overlapping points} \usage{ -geom_count(mapping = NULL, data = NULL, stat = "sum", - position = "identity", ..., na.rm = FALSE, show.legend = NA, - inherit.aes = TRUE) - -stat_sum(mapping = NULL, data = NULL, geom = "point", - position = "identity", ..., na.rm = FALSE, show.legend = NA, - inherit.aes = TRUE) +geom_count( + mapping = NULL, + data = NULL, + stat = "sum", + position = "identity", + ..., + na.rm = FALSE, + show.legend = NA, + inherit.aes = TRUE +) + +stat_sum( + mapping = NULL, + data = NULL, + geom = "point", + position = "identity", + ..., + na.rm = FALSE, + show.legend = NA, + inherit.aes = TRUE +) } \arguments{ \item{mapping}{Set of aesthetic mappings created by \code{\link[=aes]{aes()}} or diff --git a/man/geom_density.Rd b/man/geom_density.Rd index 4aa678c18f..426e7ba460 100644 --- a/man/geom_density.Rd +++ b/man/geom_density.Rd @@ -5,14 +5,34 @@ \alias{stat_density} \title{Smoothed density estimates} \usage{ -geom_density(mapping = NULL, data = NULL, stat = "density", - position = "identity", ..., na.rm = FALSE, orientation = NA, - show.legend = NA, inherit.aes = TRUE) - -stat_density(mapping = NULL, data = NULL, geom = "area", - position = "stack", ..., bw = "nrd0", adjust = 1, - kernel = "gaussian", n = 512, trim = FALSE, na.rm = FALSE, - orientation = NA, show.legend = NA, inherit.aes = TRUE) +geom_density( + mapping = NULL, + data = NULL, + stat = "density", + position = "identity", + ..., + na.rm = FALSE, + orientation = NA, + show.legend = NA, + inherit.aes = TRUE +) + +stat_density( + mapping = NULL, + data = NULL, + geom = "area", + position = "stack", + ..., + bw = "nrd0", + adjust = 1, + kernel = "gaussian", + n = 512, + trim = FALSE, + na.rm = FALSE, + orientation = NA, + show.legend = NA, + inherit.aes = TRUE +) } \arguments{ \item{mapping}{Set of aesthetic mappings created by \code{\link[=aes]{aes()}} or diff --git a/man/geom_density_2d.Rd b/man/geom_density_2d.Rd index 9f88c1aa22..7701a7e4f7 100644 --- a/man/geom_density_2d.Rd +++ b/man/geom_density_2d.Rd @@ -7,15 +7,34 @@ \alias{stat_density2d} \title{Contours of a 2d density estimate} \usage{ -geom_density_2d(mapping = NULL, data = NULL, stat = "density2d", - position = "identity", ..., lineend = "butt", linejoin = "round", - linemitre = 10, na.rm = FALSE, show.legend = NA, - inherit.aes = TRUE) - -stat_density_2d(mapping = NULL, data = NULL, geom = "density_2d", - position = "identity", ..., contour = TRUE, n = 100, h = NULL, - adjust = c(1, 1), na.rm = FALSE, show.legend = NA, - inherit.aes = TRUE) +geom_density_2d( + mapping = NULL, + data = NULL, + stat = "density2d", + position = "identity", + ..., + lineend = "butt", + linejoin = "round", + linemitre = 10, + na.rm = FALSE, + show.legend = NA, + inherit.aes = TRUE +) + +stat_density_2d( + mapping = NULL, + data = NULL, + geom = "density_2d", + position = "identity", + ..., + contour = TRUE, + n = 100, + h = NULL, + adjust = c(1, 1), + na.rm = FALSE, + show.legend = NA, + inherit.aes = TRUE +) } \arguments{ \item{mapping}{Set of aesthetic mappings created by \code{\link[=aes]{aes()}} or diff --git a/man/geom_dotplot.Rd b/man/geom_dotplot.Rd index 107555a59e..a3a4fd6874 100644 --- a/man/geom_dotplot.Rd +++ b/man/geom_dotplot.Rd @@ -4,12 +4,27 @@ \alias{geom_dotplot} \title{Dot plot} \usage{ -geom_dotplot(mapping = NULL, data = NULL, position = "identity", ..., - binwidth = NULL, binaxis = "x", method = "dotdensity", - binpositions = "bygroup", stackdir = "up", stackratio = 1, - dotsize = 1, stackgroups = FALSE, origin = NULL, right = TRUE, - width = 0.9, drop = FALSE, na.rm = FALSE, show.legend = NA, - inherit.aes = TRUE) +geom_dotplot( + mapping = NULL, + data = NULL, + position = "identity", + ..., + binwidth = NULL, + binaxis = "x", + method = "dotdensity", + binpositions = "bygroup", + stackdir = "up", + stackratio = 1, + dotsize = 1, + stackgroups = FALSE, + origin = NULL, + right = TRUE, + width = 0.9, + drop = FALSE, + na.rm = FALSE, + show.legend = NA, + inherit.aes = TRUE +) } \arguments{ \item{mapping}{Set of aesthetic mappings created by \code{\link[=aes]{aes()}} or diff --git a/man/geom_errorbarh.Rd b/man/geom_errorbarh.Rd index a266a55017..5e506942f1 100644 --- a/man/geom_errorbarh.Rd +++ b/man/geom_errorbarh.Rd @@ -4,9 +4,16 @@ \alias{geom_errorbarh} \title{Horizontal error bars} \usage{ -geom_errorbarh(mapping = NULL, data = NULL, stat = "identity", - position = "identity", ..., na.rm = FALSE, show.legend = NA, - inherit.aes = TRUE) +geom_errorbarh( + mapping = NULL, + data = NULL, + stat = "identity", + position = "identity", + ..., + na.rm = FALSE, + show.legend = NA, + inherit.aes = TRUE +) } \arguments{ \item{mapping}{Set of aesthetic mappings created by \code{\link[=aes]{aes()}} or diff --git a/man/geom_hex.Rd b/man/geom_hex.Rd index bbd29d982a..e57f753b71 100644 --- a/man/geom_hex.Rd +++ b/man/geom_hex.Rd @@ -6,13 +6,29 @@ \alias{stat_binhex} \title{Hexagonal heatmap of 2d bin counts} \usage{ -geom_hex(mapping = NULL, data = NULL, stat = "binhex", - position = "identity", ..., na.rm = FALSE, show.legend = NA, - inherit.aes = TRUE) - -stat_bin_hex(mapping = NULL, data = NULL, geom = "hex", - position = "identity", ..., bins = 30, binwidth = NULL, - na.rm = FALSE, show.legend = NA, inherit.aes = TRUE) +geom_hex( + mapping = NULL, + data = NULL, + stat = "binhex", + position = "identity", + ..., + na.rm = FALSE, + show.legend = NA, + inherit.aes = TRUE +) + +stat_bin_hex( + mapping = NULL, + data = NULL, + geom = "hex", + position = "identity", + ..., + bins = 30, + binwidth = NULL, + na.rm = FALSE, + show.legend = NA, + inherit.aes = TRUE +) } \arguments{ \item{mapping}{Set of aesthetic mappings created by \code{\link[=aes]{aes()}} or diff --git a/man/geom_histogram.Rd b/man/geom_histogram.Rd index 228c06c73a..2bbc240fce 100644 --- a/man/geom_histogram.Rd +++ b/man/geom_histogram.Rd @@ -7,20 +7,49 @@ \alias{stat_bin} \title{Histograms and frequency polygons} \usage{ -geom_freqpoly(mapping = NULL, data = NULL, stat = "bin", - position = "identity", ..., na.rm = FALSE, show.legend = NA, - inherit.aes = TRUE) - -geom_histogram(mapping = NULL, data = NULL, stat = "bin", - position = "stack", ..., binwidth = NULL, bins = NULL, - na.rm = FALSE, orientation = NA, show.legend = NA, - inherit.aes = TRUE) - -stat_bin(mapping = NULL, data = NULL, geom = "bar", - position = "stack", ..., binwidth = NULL, bins = NULL, - center = NULL, boundary = NULL, breaks = NULL, - closed = c("right", "left"), pad = FALSE, na.rm = FALSE, - orientation = NA, show.legend = NA, inherit.aes = TRUE) +geom_freqpoly( + mapping = NULL, + data = NULL, + stat = "bin", + position = "identity", + ..., + na.rm = FALSE, + show.legend = NA, + inherit.aes = TRUE +) + +geom_histogram( + mapping = NULL, + data = NULL, + stat = "bin", + position = "stack", + ..., + binwidth = NULL, + bins = NULL, + na.rm = FALSE, + orientation = NA, + show.legend = NA, + inherit.aes = TRUE +) + +stat_bin( + mapping = NULL, + data = NULL, + geom = "bar", + position = "stack", + ..., + binwidth = NULL, + bins = NULL, + center = NULL, + boundary = NULL, + breaks = NULL, + closed = c("right", "left"), + pad = FALSE, + na.rm = FALSE, + orientation = NA, + show.legend = NA, + inherit.aes = TRUE +) } \arguments{ \item{mapping}{Set of aesthetic mappings created by \code{\link[=aes]{aes()}} or diff --git a/man/geom_jitter.Rd b/man/geom_jitter.Rd index 3f999f4976..ed2dd8fb27 100644 --- a/man/geom_jitter.Rd +++ b/man/geom_jitter.Rd @@ -4,9 +4,18 @@ \alias{geom_jitter} \title{Jittered points} \usage{ -geom_jitter(mapping = NULL, data = NULL, stat = "identity", - position = "jitter", ..., width = NULL, height = NULL, - na.rm = FALSE, show.legend = NA, inherit.aes = TRUE) +geom_jitter( + mapping = NULL, + data = NULL, + stat = "identity", + position = "jitter", + ..., + width = NULL, + height = NULL, + na.rm = FALSE, + show.legend = NA, + inherit.aes = TRUE +) } \arguments{ \item{mapping}{Set of aesthetic mappings created by \code{\link[=aes]{aes()}} or diff --git a/man/geom_linerange.Rd b/man/geom_linerange.Rd index 9e18cdfe89..16fed3db03 100644 --- a/man/geom_linerange.Rd +++ b/man/geom_linerange.Rd @@ -8,21 +8,55 @@ \alias{geom_pointrange} \title{Vertical intervals: lines, crossbars & errorbars} \usage{ -geom_crossbar(mapping = NULL, data = NULL, stat = "identity", - position = "identity", ..., fatten = 2.5, na.rm = FALSE, - orientation = NA, show.legend = NA, inherit.aes = TRUE) +geom_crossbar( + mapping = NULL, + data = NULL, + stat = "identity", + position = "identity", + ..., + fatten = 2.5, + na.rm = FALSE, + orientation = NA, + show.legend = NA, + inherit.aes = TRUE +) -geom_errorbar(mapping = NULL, data = NULL, stat = "identity", - position = "identity", ..., na.rm = FALSE, orientation = NA, - show.legend = NA, inherit.aes = TRUE) +geom_errorbar( + mapping = NULL, + data = NULL, + stat = "identity", + position = "identity", + ..., + na.rm = FALSE, + orientation = NA, + show.legend = NA, + inherit.aes = TRUE +) -geom_linerange(mapping = NULL, data = NULL, stat = "identity", - position = "identity", ..., na.rm = FALSE, orientation = NA, - show.legend = NA, inherit.aes = TRUE) +geom_linerange( + mapping = NULL, + data = NULL, + stat = "identity", + position = "identity", + ..., + na.rm = FALSE, + orientation = NA, + show.legend = NA, + inherit.aes = TRUE +) -geom_pointrange(mapping = NULL, data = NULL, stat = "identity", - position = "identity", ..., fatten = 4, na.rm = FALSE, - orientation = NA, show.legend = NA, inherit.aes = TRUE) +geom_pointrange( + mapping = NULL, + data = NULL, + stat = "identity", + position = "identity", + ..., + fatten = 4, + na.rm = FALSE, + orientation = NA, + show.legend = NA, + inherit.aes = TRUE +) } \arguments{ \item{mapping}{Set of aesthetic mappings created by \code{\link[=aes]{aes()}} or diff --git a/man/geom_map.Rd b/man/geom_map.Rd index adde0e8289..1e160069d1 100644 --- a/man/geom_map.Rd +++ b/man/geom_map.Rd @@ -4,8 +4,16 @@ \alias{geom_map} \title{Polygons from a reference map} \usage{ -geom_map(mapping = NULL, data = NULL, stat = "identity", ..., map, - na.rm = FALSE, show.legend = NA, inherit.aes = TRUE) +geom_map( + mapping = NULL, + data = NULL, + stat = "identity", + ..., + map, + na.rm = FALSE, + show.legend = NA, + inherit.aes = TRUE +) } \arguments{ \item{mapping}{Set of aesthetic mappings created by \code{\link[=aes]{aes()}} or diff --git a/man/geom_path.Rd b/man/geom_path.Rd index 5685b91c23..3a1b80458e 100644 --- a/man/geom_path.Rd +++ b/man/geom_path.Rd @@ -6,18 +6,44 @@ \alias{geom_step} \title{Connect observations} \usage{ -geom_path(mapping = NULL, data = NULL, stat = "identity", - position = "identity", ..., lineend = "butt", linejoin = "round", - linemitre = 10, arrow = NULL, na.rm = FALSE, show.legend = NA, - inherit.aes = TRUE) - -geom_line(mapping = NULL, data = NULL, stat = "identity", - position = "identity", na.rm = FALSE, orientation = NA, - show.legend = NA, inherit.aes = TRUE, ...) - -geom_step(mapping = NULL, data = NULL, stat = "identity", - position = "identity", direction = "hv", na.rm = FALSE, - show.legend = NA, inherit.aes = TRUE, ...) +geom_path( + mapping = NULL, + data = NULL, + stat = "identity", + position = "identity", + ..., + lineend = "butt", + linejoin = "round", + linemitre = 10, + arrow = NULL, + na.rm = FALSE, + show.legend = NA, + inherit.aes = TRUE +) + +geom_line( + mapping = NULL, + data = NULL, + stat = "identity", + position = "identity", + na.rm = FALSE, + orientation = NA, + show.legend = NA, + inherit.aes = TRUE, + ... +) + +geom_step( + mapping = NULL, + data = NULL, + stat = "identity", + position = "identity", + direction = "hv", + na.rm = FALSE, + show.legend = NA, + inherit.aes = TRUE, + ... +) } \arguments{ \item{mapping}{Set of aesthetic mappings created by \code{\link[=aes]{aes()}} or diff --git a/man/geom_point.Rd b/man/geom_point.Rd index 3975805faf..4e6cb2d1d4 100644 --- a/man/geom_point.Rd +++ b/man/geom_point.Rd @@ -4,9 +4,16 @@ \alias{geom_point} \title{Points} \usage{ -geom_point(mapping = NULL, data = NULL, stat = "identity", - position = "identity", ..., na.rm = FALSE, show.legend = NA, - inherit.aes = TRUE) +geom_point( + mapping = NULL, + data = NULL, + stat = "identity", + position = "identity", + ..., + na.rm = FALSE, + show.legend = NA, + inherit.aes = TRUE +) } \arguments{ \item{mapping}{Set of aesthetic mappings created by \code{\link[=aes]{aes()}} or diff --git a/man/geom_polygon.Rd b/man/geom_polygon.Rd index 54409c8dde..f0b8fd81cc 100644 --- a/man/geom_polygon.Rd +++ b/man/geom_polygon.Rd @@ -4,9 +4,17 @@ \alias{geom_polygon} \title{Polygons} \usage{ -geom_polygon(mapping = NULL, data = NULL, stat = "identity", - position = "identity", rule = "evenodd", ..., na.rm = FALSE, - show.legend = NA, inherit.aes = TRUE) +geom_polygon( + mapping = NULL, + data = NULL, + stat = "identity", + position = "identity", + rule = "evenodd", + ..., + na.rm = FALSE, + show.legend = NA, + inherit.aes = TRUE +) } \arguments{ \item{mapping}{Set of aesthetic mappings created by \code{\link[=aes]{aes()}} or diff --git a/man/geom_qq.Rd b/man/geom_qq.Rd index ea9c743f88..88e6037a74 100644 --- a/man/geom_qq.Rd +++ b/man/geom_qq.Rd @@ -7,25 +7,61 @@ \alias{stat_qq} \title{A quantile-quantile plot} \usage{ -geom_qq_line(mapping = NULL, data = NULL, geom = "path", - position = "identity", ..., distribution = stats::qnorm, - dparams = list(), line.p = c(0.25, 0.75), fullrange = FALSE, - na.rm = FALSE, show.legend = NA, inherit.aes = TRUE) - -stat_qq_line(mapping = NULL, data = NULL, geom = "path", - position = "identity", ..., distribution = stats::qnorm, - dparams = list(), line.p = c(0.25, 0.75), fullrange = FALSE, - na.rm = FALSE, show.legend = NA, inherit.aes = TRUE) - -geom_qq(mapping = NULL, data = NULL, geom = "point", - position = "identity", ..., distribution = stats::qnorm, - dparams = list(), na.rm = FALSE, show.legend = NA, - inherit.aes = TRUE) - -stat_qq(mapping = NULL, data = NULL, geom = "point", - position = "identity", ..., distribution = stats::qnorm, - dparams = list(), na.rm = FALSE, show.legend = NA, - inherit.aes = TRUE) +geom_qq_line( + mapping = NULL, + data = NULL, + geom = "path", + position = "identity", + ..., + distribution = stats::qnorm, + dparams = list(), + line.p = c(0.25, 0.75), + fullrange = FALSE, + na.rm = FALSE, + show.legend = NA, + inherit.aes = TRUE +) + +stat_qq_line( + mapping = NULL, + data = NULL, + geom = "path", + position = "identity", + ..., + distribution = stats::qnorm, + dparams = list(), + line.p = c(0.25, 0.75), + fullrange = FALSE, + na.rm = FALSE, + show.legend = NA, + inherit.aes = TRUE +) + +geom_qq( + mapping = NULL, + data = NULL, + geom = "point", + position = "identity", + ..., + distribution = stats::qnorm, + dparams = list(), + na.rm = FALSE, + show.legend = NA, + inherit.aes = TRUE +) + +stat_qq( + mapping = NULL, + data = NULL, + geom = "point", + position = "identity", + ..., + distribution = stats::qnorm, + dparams = list(), + na.rm = FALSE, + show.legend = NA, + inherit.aes = TRUE +) } \arguments{ \item{mapping}{Set of aesthetic mappings created by \code{\link[=aes]{aes()}} or diff --git a/man/geom_quantile.Rd b/man/geom_quantile.Rd index 820f9485fd..984406de15 100644 --- a/man/geom_quantile.Rd +++ b/man/geom_quantile.Rd @@ -5,15 +5,34 @@ \alias{stat_quantile} \title{Quantile regression} \usage{ -geom_quantile(mapping = NULL, data = NULL, stat = "quantile", - position = "identity", ..., lineend = "butt", linejoin = "round", - linemitre = 10, na.rm = FALSE, show.legend = NA, - inherit.aes = TRUE) - -stat_quantile(mapping = NULL, data = NULL, geom = "quantile", - position = "identity", ..., quantiles = c(0.25, 0.5, 0.75), - formula = NULL, method = "rq", method.args = list(), - na.rm = FALSE, show.legend = NA, inherit.aes = TRUE) +geom_quantile( + mapping = NULL, + data = NULL, + stat = "quantile", + position = "identity", + ..., + lineend = "butt", + linejoin = "round", + linemitre = 10, + na.rm = FALSE, + show.legend = NA, + inherit.aes = TRUE +) + +stat_quantile( + mapping = NULL, + data = NULL, + geom = "quantile", + position = "identity", + ..., + quantiles = c(0.25, 0.5, 0.75), + formula = NULL, + method = "rq", + method.args = list(), + na.rm = FALSE, + show.legend = NA, + inherit.aes = TRUE +) } \arguments{ \item{mapping}{Set of aesthetic mappings created by \code{\link[=aes]{aes()}} or diff --git a/man/geom_ribbon.Rd b/man/geom_ribbon.Rd index db771c5387..ceb1e7a013 100644 --- a/man/geom_ribbon.Rd +++ b/man/geom_ribbon.Rd @@ -5,13 +5,29 @@ \alias{geom_area} \title{Ribbons and area plots} \usage{ -geom_ribbon(mapping = NULL, data = NULL, stat = "identity", - position = "identity", ..., na.rm = FALSE, orientation = NA, - show.legend = NA, inherit.aes = TRUE) - -geom_area(mapping = NULL, data = NULL, stat = "identity", - position = "stack", na.rm = FALSE, orientation = NA, - show.legend = NA, inherit.aes = TRUE, ...) +geom_ribbon( + mapping = NULL, + data = NULL, + stat = "identity", + position = "identity", + ..., + na.rm = FALSE, + orientation = NA, + show.legend = NA, + inherit.aes = TRUE +) + +geom_area( + mapping = NULL, + data = NULL, + stat = "identity", + position = "stack", + na.rm = FALSE, + orientation = NA, + show.legend = NA, + inherit.aes = TRUE, + ... +) } \arguments{ \item{mapping}{Set of aesthetic mappings created by \code{\link[=aes]{aes()}} or diff --git a/man/geom_rug.Rd b/man/geom_rug.Rd index 71937e8da9..45de20c05d 100644 --- a/man/geom_rug.Rd +++ b/man/geom_rug.Rd @@ -4,10 +4,19 @@ \alias{geom_rug} \title{Rug plots in the margins} \usage{ -geom_rug(mapping = NULL, data = NULL, stat = "identity", - position = "identity", ..., outside = FALSE, sides = "bl", - length = unit(0.03, "npc"), na.rm = FALSE, show.legend = NA, - inherit.aes = TRUE) +geom_rug( + mapping = NULL, + data = NULL, + stat = "identity", + position = "identity", + ..., + outside = FALSE, + sides = "bl", + length = unit(0.03, "npc"), + na.rm = FALSE, + show.legend = NA, + inherit.aes = TRUE +) } \arguments{ \item{mapping}{Set of aesthetic mappings created by \code{\link[=aes]{aes()}} or diff --git a/man/geom_segment.Rd b/man/geom_segment.Rd index 76124f5f7e..ef998902dd 100644 --- a/man/geom_segment.Rd +++ b/man/geom_segment.Rd @@ -5,15 +5,37 @@ \alias{geom_curve} \title{Line segments and curves} \usage{ -geom_segment(mapping = NULL, data = NULL, stat = "identity", - position = "identity", ..., arrow = NULL, arrow.fill = NULL, - lineend = "butt", linejoin = "round", na.rm = FALSE, - show.legend = NA, inherit.aes = TRUE) - -geom_curve(mapping = NULL, data = NULL, stat = "identity", - position = "identity", ..., curvature = 0.5, angle = 90, ncp = 5, - arrow = NULL, arrow.fill = NULL, lineend = "butt", na.rm = FALSE, - show.legend = NA, inherit.aes = TRUE) +geom_segment( + mapping = NULL, + data = NULL, + stat = "identity", + position = "identity", + ..., + arrow = NULL, + arrow.fill = NULL, + lineend = "butt", + linejoin = "round", + na.rm = FALSE, + show.legend = NA, + inherit.aes = TRUE +) + +geom_curve( + mapping = NULL, + data = NULL, + stat = "identity", + position = "identity", + ..., + curvature = 0.5, + angle = 90, + ncp = 5, + arrow = NULL, + arrow.fill = NULL, + lineend = "butt", + na.rm = FALSE, + show.legend = NA, + inherit.aes = TRUE +) } \arguments{ \item{mapping}{Set of aesthetic mappings created by \code{\link[=aes]{aes()}} or diff --git a/man/geom_smooth.Rd b/man/geom_smooth.Rd index 7b7d67cfa1..e91fc73a65 100644 --- a/man/geom_smooth.Rd +++ b/man/geom_smooth.Rd @@ -5,16 +5,40 @@ \alias{stat_smooth} \title{Smoothed conditional means} \usage{ -geom_smooth(mapping = NULL, data = NULL, stat = "smooth", - position = "identity", ..., method = NULL, formula = NULL, - se = TRUE, na.rm = FALSE, orientation = NA, show.legend = NA, - inherit.aes = TRUE) - -stat_smooth(mapping = NULL, data = NULL, geom = "smooth", - position = "identity", ..., method = NULL, formula = NULL, - se = TRUE, n = 80, span = 0.75, fullrange = FALSE, - level = 0.95, method.args = list(), na.rm = FALSE, - orientation = NA, show.legend = NA, inherit.aes = TRUE) +geom_smooth( + mapping = NULL, + data = NULL, + stat = "smooth", + position = "identity", + ..., + method = NULL, + formula = NULL, + se = TRUE, + na.rm = FALSE, + orientation = NA, + show.legend = NA, + inherit.aes = TRUE +) + +stat_smooth( + mapping = NULL, + data = NULL, + geom = "smooth", + position = "identity", + ..., + method = NULL, + formula = NULL, + se = TRUE, + n = 80, + span = 0.75, + fullrange = FALSE, + level = 0.95, + method.args = list(), + na.rm = FALSE, + orientation = NA, + show.legend = NA, + inherit.aes = TRUE +) } \arguments{ \item{mapping}{Set of aesthetic mappings created by \code{\link[=aes]{aes()}} or @@ -60,7 +84,7 @@ so does not work for larger datasets. If you have fewer than 1,000 observations but want to use the same \code{gam()} model that \code{method = NULL} would use, then set -\code{method = "gam", formula = y ~ s(x, bs = "cs")}.} +\verb{method = "gam", formula = y ~ s(x, bs = "cs")}.} \item{formula}{Formula to use in smoothing function, eg. \code{y ~ x}, \code{y ~ poly(x, 2)}, \code{y ~ log(x)}. \code{NULL} by default, in which case diff --git a/man/geom_spoke.Rd b/man/geom_spoke.Rd index fe40a4981d..cfcd51c0dd 100644 --- a/man/geom_spoke.Rd +++ b/man/geom_spoke.Rd @@ -5,9 +5,16 @@ \alias{stat_spoke} \title{Line segments parameterised by location, direction and distance} \usage{ -geom_spoke(mapping = NULL, data = NULL, stat = "identity", - position = "identity", ..., na.rm = FALSE, show.legend = NA, - inherit.aes = TRUE) +geom_spoke( + mapping = NULL, + data = NULL, + stat = "identity", + position = "identity", + ..., + na.rm = FALSE, + show.legend = NA, + inherit.aes = TRUE +) } \arguments{ \item{mapping}{Set of aesthetic mappings created by \code{\link[=aes]{aes()}} or diff --git a/man/geom_text.Rd b/man/geom_text.Rd index c43e79da98..479ee6918f 100644 --- a/man/geom_text.Rd +++ b/man/geom_text.Rd @@ -5,16 +5,37 @@ \alias{geom_text} \title{Text} \usage{ -geom_label(mapping = NULL, data = NULL, stat = "identity", - position = "identity", ..., parse = FALSE, nudge_x = 0, - nudge_y = 0, label.padding = unit(0.25, "lines"), - label.r = unit(0.15, "lines"), label.size = 0.25, na.rm = FALSE, - show.legend = NA, inherit.aes = TRUE) - -geom_text(mapping = NULL, data = NULL, stat = "identity", - position = "identity", ..., parse = FALSE, nudge_x = 0, - nudge_y = 0, check_overlap = FALSE, na.rm = FALSE, - show.legend = NA, inherit.aes = TRUE) +geom_label( + mapping = NULL, + data = NULL, + stat = "identity", + position = "identity", + ..., + parse = FALSE, + nudge_x = 0, + nudge_y = 0, + label.padding = unit(0.25, "lines"), + label.r = unit(0.15, "lines"), + label.size = 0.25, + na.rm = FALSE, + show.legend = NA, + inherit.aes = TRUE +) + +geom_text( + mapping = NULL, + data = NULL, + stat = "identity", + position = "identity", + ..., + parse = FALSE, + nudge_x = 0, + nudge_y = 0, + check_overlap = FALSE, + na.rm = FALSE, + show.legend = NA, + inherit.aes = TRUE +) } \arguments{ \item{mapping}{Set of aesthetic mappings created by \code{\link[=aes]{aes()}} or diff --git a/man/geom_tile.Rd b/man/geom_tile.Rd index cf24a3e510..5ce27ade3f 100644 --- a/man/geom_tile.Rd +++ b/man/geom_tile.Rd @@ -6,18 +6,43 @@ \alias{geom_tile} \title{Rectangles} \usage{ -geom_raster(mapping = NULL, data = NULL, stat = "identity", - position = "identity", ..., hjust = 0.5, vjust = 0.5, - interpolate = FALSE, na.rm = FALSE, show.legend = NA, - inherit.aes = TRUE) - -geom_rect(mapping = NULL, data = NULL, stat = "identity", - position = "identity", ..., linejoin = "mitre", na.rm = FALSE, - show.legend = NA, inherit.aes = TRUE) - -geom_tile(mapping = NULL, data = NULL, stat = "identity", - position = "identity", ..., linejoin = "mitre", na.rm = FALSE, - show.legend = NA, inherit.aes = TRUE) +geom_raster( + mapping = NULL, + data = NULL, + stat = "identity", + position = "identity", + ..., + hjust = 0.5, + vjust = 0.5, + interpolate = FALSE, + na.rm = FALSE, + show.legend = NA, + inherit.aes = TRUE +) + +geom_rect( + mapping = NULL, + data = NULL, + stat = "identity", + position = "identity", + ..., + linejoin = "mitre", + na.rm = FALSE, + show.legend = NA, + inherit.aes = TRUE +) + +geom_tile( + mapping = NULL, + data = NULL, + stat = "identity", + position = "identity", + ..., + linejoin = "mitre", + na.rm = FALSE, + show.legend = NA, + inherit.aes = TRUE +) } \arguments{ \item{mapping}{Set of aesthetic mappings created by \code{\link[=aes]{aes()}} or diff --git a/man/geom_violin.Rd b/man/geom_violin.Rd index a290448257..1b0c847458 100644 --- a/man/geom_violin.Rd +++ b/man/geom_violin.Rd @@ -5,15 +5,37 @@ \alias{stat_ydensity} \title{Violin plot} \usage{ -geom_violin(mapping = NULL, data = NULL, stat = "ydensity", - position = "dodge", ..., draw_quantiles = NULL, trim = TRUE, - scale = "area", na.rm = FALSE, orientation = NA, - show.legend = NA, inherit.aes = TRUE) - -stat_ydensity(mapping = NULL, data = NULL, geom = "violin", - position = "dodge", ..., bw = "nrd0", adjust = 1, - kernel = "gaussian", trim = TRUE, scale = "area", na.rm = FALSE, - orientation = NA, show.legend = NA, inherit.aes = TRUE) +geom_violin( + mapping = NULL, + data = NULL, + stat = "ydensity", + position = "dodge", + ..., + draw_quantiles = NULL, + trim = TRUE, + scale = "area", + na.rm = FALSE, + orientation = NA, + show.legend = NA, + inherit.aes = TRUE +) + +stat_ydensity( + mapping = NULL, + data = NULL, + geom = "violin", + position = "dodge", + ..., + bw = "nrd0", + adjust = 1, + kernel = "gaussian", + trim = TRUE, + scale = "area", + na.rm = FALSE, + orientation = NA, + show.legend = NA, + inherit.aes = TRUE +) } \arguments{ \item{mapping}{Set of aesthetic mappings created by \code{\link[=aes]{aes()}} or diff --git a/man/gg-add.Rd b/man/gg-add.Rd index a5b29330d4..f689cb28bd 100644 --- a/man/gg-add.Rd +++ b/man/gg-add.Rd @@ -32,7 +32,7 @@ new layer. \item A \code{facet} specification overrides the current faceting. } -To replace the current default data frame, you must use \code{\%+\%}, +To replace the current default data frame, you must use \verb{\%+\%}, due to S3 method precedence issues. You can also supply a list, in which case each element of the list will diff --git a/man/ggplot.Rd b/man/ggplot.Rd index b3afa2bac9..c1390d18e3 100644 --- a/man/ggplot.Rd +++ b/man/ggplot.Rd @@ -4,8 +4,7 @@ \alias{ggplot} \title{Create a new ggplot} \usage{ -ggplot(data = NULL, mapping = aes(), ..., - environment = parent.frame()) +ggplot(data = NULL, mapping = aes(), ..., environment = parent.frame()) } \arguments{ \item{data}{Default dataset to use for plot. If not already a data.frame, @@ -30,7 +29,7 @@ subsequent layers unless specifically overridden. and is almost always followed by \code{+} to add component to the plot. There are three common ways to invoke \code{ggplot}: \itemize{ -\item \code{ggplot(df, aes(x, y, other aesthetics))} +\item \verb{ggplot(df, aes(x, y, other aesthetics))} \item \code{ggplot(df)} \item \code{ggplot()} } diff --git a/man/ggplot2-ggproto.Rd b/man/ggplot2-ggproto.Rd index 75605bc356..3b3053e300 100644 --- a/man/ggplot2-ggproto.Rd +++ b/man/ggplot2-ggproto.Rd @@ -137,11 +137,11 @@ you'll need to extend from \code{ggplot2::Geom}, \code{ggplot2::Stat}, \section{Geoms}{ -All \code{geom_*} functions (like \code{geom_point}) return a layer that -contains a \code{Geom*} object (like \code{GeomPoint}). The \code{Geom*} +All \verb{geom_*} functions (like \code{geom_point}) return a layer that +contains a \verb{Geom*} object (like \code{GeomPoint}). The \verb{Geom*} object is responsible for rendering the data in the plot. -Each of the \code{Geom*} objects is a \code{\link[=ggproto]{ggproto()}} object, descended +Each of the \verb{Geom*} objects is a \code{\link[=ggproto]{ggproto()}} object, descended from the top-level \code{Geom}, and each implements various methods and fields. @@ -191,10 +191,10 @@ and ymin and ymax values. It can potentially set other values as well. \section{Coordinate systems}{ -All \code{coord_*} functions (like \code{coord_trans}) return a \code{Coord*} +All \verb{coord_*} functions (like \code{coord_trans}) return a \verb{Coord*} object (like \code{CoordTrans}). -Each of the \code{Coord*} objects is a \code{\link[=ggproto]{ggproto()}} object, +Each of the \verb{Coord*} objects is a \code{\link[=ggproto]{ggproto()}} object, descended from the top-level \code{Coord}. To create a new type of Coord object, you typically will want to implement one or more of the following: \itemize{ @@ -240,7 +240,7 @@ data to panels and scales. \section{Facets}{ -All \code{facet_*} functions returns a \code{Facet} object or an object of a +All \verb{facet_*} functions returns a \code{Facet} object or an object of a \code{Facet} subclass. This object describes how to assign data to different panels, how to apply positional scales and how to lay out the panels, once rendered. @@ -310,11 +310,11 @@ transformations has been applied. \section{Stats}{ -All \code{stat_*} functions (like \code{stat_bin}) return a layer that -contains a \code{Stat*} object (like \code{StatBin}). The \code{Stat*} +All \verb{stat_*} functions (like \code{stat_bin}) return a layer that +contains a \verb{Stat*} object (like \code{StatBin}). The \verb{Stat*} object is responsible for rendering the data in the plot. -Each of the \code{Stat*} objects is a \code{\link[=ggproto]{ggproto()}} object, descended +Each of the \verb{Stat*} objects is a \code{\link[=ggproto]{ggproto()}} object, descended from the top-level \code{Stat}, and each implements various methods and fields. To create a new type of Stat object, you typically will want to override one or more of the following: @@ -361,16 +361,16 @@ default values for aesthetics. \section{Positions}{ -All \code{position_*} functions (like \code{position_dodge}) return a -\code{Position*} object (like \code{PositionDodge}). The \code{Position*} +All \verb{position_*} functions (like \code{position_dodge}) return a +\verb{Position*} object (like \code{PositionDodge}). The \verb{Position*} object is responsible for adjusting the position of overlapping geoms. -The way that the \code{position_*} functions work is slightly different from -the \code{geom_*} and \code{stat_*} functions, because a \code{position_*} -function actually "instantiates" the \code{Position*} object by creating a +The way that the \verb{position_*} functions work is slightly different from +the \verb{geom_*} and \verb{stat_*} functions, because a \verb{position_*} +function actually "instantiates" the \verb{Position*} object by creating a descendant, and returns that. -Each of the \code{Position*} objects is a \code{\link[=ggproto]{ggproto()}} object, +Each of the \verb{Position*} objects is a \code{\link[=ggproto]{ggproto()}} object, descended from the top-level \code{Position}, and each implements the following methods: \itemize{ @@ -404,8 +404,8 @@ that must be present for this position adjustment to work. \section{Scales}{ -All \code{scale_*} functions like \code{\link[=scale_x_continuous]{scale_x_continuous()}} return a \code{Scale*} -object like \code{ScaleContinuous}. Each of the \code{Scale*} objects is a \code{\link[=ggproto]{ggproto()}} +All \verb{scale_*} functions like \code{\link[=scale_x_continuous]{scale_x_continuous()}} return a \verb{Scale*} +object like \code{ScaleContinuous}. Each of the \verb{Scale*} objects is a \code{\link[=ggproto]{ggproto()}} object, descended from the top-level \code{Scale}. Properties not documented in \code{\link[=continuous_scale]{continuous_scale()}} or \code{\link[=discrete_scale]{discrete_scale()}}: @@ -438,7 +438,7 @@ was provided to the constructor. \code{rescale()} does not apply \code{self$oob( its input, which means that discrete values outside \code{limits} will be \code{NA}, and values that are outside \code{range} will have values less than 0 or greater than 1. This allows guides more control over how out-of-bounds values are displayed. -\item \code{transform_df()}, \code{train_df()}, \code{map_df()} These \code{_df} variants +\item \code{transform_df()}, \code{train_df()}, \code{map_df()} These \verb{_df} variants accept a data frame, and apply the \code{transform}, \code{train}, and \code{map} methods (respectively) to the columns whose names are in \code{self$aesthetics}. \item \code{get_limits()} Calculates the final scale limits in transformed data space diff --git a/man/ggplot2-package.Rd b/man/ggplot2-package.Rd index 922021f8f1..0eee1459e6 100644 --- a/man/ggplot2-package.Rd +++ b/man/ggplot2-package.Rd @@ -6,7 +6,7 @@ \alias{ggplot2-package} \title{ggplot2: Create Elegant Data Visualisations Using the Grammar of Graphics} \description{ -\if{html}{\figure{logo.png}{options: align='right'}} +\if{html}{\figure{logo.png}{options: align='right' alt='logo' width='120'}} A system for 'declaratively' creating graphics, based on "The Grammar of Graphics". You provide the data, tell 'ggplot2' diff --git a/man/ggsave.Rd b/man/ggsave.Rd index 72725d51fd..45cb05c396 100644 --- a/man/ggsave.Rd +++ b/man/ggsave.Rd @@ -4,9 +4,19 @@ \alias{ggsave} \title{Save a ggplot (or other grid object) with sensible defaults} \usage{ -ggsave(filename, plot = last_plot(), device = NULL, path = NULL, - scale = 1, width = NA, height = NA, units = c("in", "cm", "mm"), - dpi = 300, limitsize = TRUE, ...) +ggsave( + filename, + plot = last_plot(), + device = NULL, + path = NULL, + scale = 1, + width = NA, + height = NA, + units = c("in", "cm", "mm"), + dpi = 300, + limitsize = TRUE, + ... +) } \arguments{ \item{filename}{File name to create on disk.} @@ -44,12 +54,12 @@ extension. } \details{ Note: Filenames with page numbers can be generated by including a C -integer format expression, such as \code{\%03d} (as in the default file name +integer format expression, such as \verb{\%03d} (as in the default file name for most R graphics devices, see e.g. \code{\link[=png]{png()}}). Thus, \code{filename = "figure\%03d.png"} will produce successive filenames \code{figure001.png}, \code{figure002.png}, \code{figure003.png}, etc. To write a filename -containing the \code{\%} sign, use \code{\%\%}. For example, \code{filename = "figure-100\%\%.png"} -will produce the filename \code{figure-100\%.png}. +containing the \verb{\%} sign, use \code{\%\%}. For example, \code{filename = "figure-100\%\%.png"} +will produce the filename \verb{figure-100\%.png}. } \examples{ \dontrun{ diff --git a/man/ggsf.Rd b/man/ggsf.Rd index 3b16abc7e2..da03f7f8d3 100644 --- a/man/ggsf.Rd +++ b/man/ggsf.Rd @@ -13,29 +13,74 @@ \alias{stat_sf} \title{Visualise sf objects} \usage{ -coord_sf(xlim = NULL, ylim = NULL, expand = TRUE, crs = NULL, - datum = sf::st_crs(4326), label_graticule = waiver(), - label_axes = waiver(), ndiscr = 100, default = FALSE, - clip = "on") - -geom_sf(mapping = aes(), data = NULL, stat = "sf", - position = "identity", na.rm = FALSE, show.legend = NA, - inherit.aes = TRUE, ...) - -geom_sf_label(mapping = aes(), data = NULL, stat = "sf_coordinates", - position = "identity", ..., parse = FALSE, nudge_x = 0, - nudge_y = 0, label.padding = unit(0.25, "lines"), - label.r = unit(0.15, "lines"), label.size = 0.25, na.rm = FALSE, - show.legend = NA, inherit.aes = TRUE, fun.geometry = NULL) - -geom_sf_text(mapping = aes(), data = NULL, stat = "sf_coordinates", - position = "identity", ..., parse = FALSE, nudge_x = 0, - nudge_y = 0, check_overlap = FALSE, na.rm = FALSE, - show.legend = NA, inherit.aes = TRUE, fun.geometry = NULL) - -stat_sf(mapping = NULL, data = NULL, geom = "rect", - position = "identity", na.rm = FALSE, show.legend = NA, - inherit.aes = TRUE, ...) +coord_sf( + xlim = NULL, + ylim = NULL, + expand = TRUE, + crs = NULL, + datum = sf::st_crs(4326), + label_graticule = waiver(), + label_axes = waiver(), + ndiscr = 100, + default = FALSE, + clip = "on" +) + +geom_sf( + mapping = aes(), + data = NULL, + stat = "sf", + position = "identity", + na.rm = FALSE, + show.legend = NA, + inherit.aes = TRUE, + ... +) + +geom_sf_label( + mapping = aes(), + data = NULL, + stat = "sf_coordinates", + position = "identity", + ..., + parse = FALSE, + nudge_x = 0, + nudge_y = 0, + label.padding = unit(0.25, "lines"), + label.r = unit(0.15, "lines"), + label.size = 0.25, + na.rm = FALSE, + show.legend = NA, + inherit.aes = TRUE, + fun.geometry = NULL +) + +geom_sf_text( + mapping = aes(), + data = NULL, + stat = "sf_coordinates", + position = "identity", + ..., + parse = FALSE, + nudge_x = 0, + nudge_y = 0, + check_overlap = FALSE, + na.rm = FALSE, + show.legend = NA, + inherit.aes = TRUE, + fun.geometry = NULL +) + +stat_sf( + mapping = NULL, + data = NULL, + geom = "rect", + position = "identity", + na.rm = FALSE, + show.legend = NA, + inherit.aes = TRUE, + ... +) } \arguments{ \item{xlim}{Limits for the x and y axes.} diff --git a/man/ggtheme.Rd b/man/ggtheme.Rd index 46e01ac6b3..3b1586b9f0 100644 --- a/man/ggtheme.Rd +++ b/man/ggtheme.Rd @@ -13,35 +13,75 @@ \alias{theme_test} \title{Complete themes} \usage{ -theme_grey(base_size = 11, base_family = "", - base_line_size = base_size/22, base_rect_size = base_size/22) - -theme_gray(base_size = 11, base_family = "", - base_line_size = base_size/22, base_rect_size = base_size/22) - -theme_bw(base_size = 11, base_family = "", - base_line_size = base_size/22, base_rect_size = base_size/22) - -theme_linedraw(base_size = 11, base_family = "", - base_line_size = base_size/22, base_rect_size = base_size/22) - -theme_light(base_size = 11, base_family = "", - base_line_size = base_size/22, base_rect_size = base_size/22) - -theme_dark(base_size = 11, base_family = "", - base_line_size = base_size/22, base_rect_size = base_size/22) - -theme_minimal(base_size = 11, base_family = "", - base_line_size = base_size/22, base_rect_size = base_size/22) - -theme_classic(base_size = 11, base_family = "", - base_line_size = base_size/22, base_rect_size = base_size/22) - -theme_void(base_size = 11, base_family = "", - base_line_size = base_size/22, base_rect_size = base_size/22) - -theme_test(base_size = 11, base_family = "", - base_line_size = base_size/22, base_rect_size = base_size/22) +theme_grey( + base_size = 11, + base_family = "", + base_line_size = base_size/22, + base_rect_size = base_size/22 +) + +theme_gray( + base_size = 11, + base_family = "", + base_line_size = base_size/22, + base_rect_size = base_size/22 +) + +theme_bw( + base_size = 11, + base_family = "", + base_line_size = base_size/22, + base_rect_size = base_size/22 +) + +theme_linedraw( + base_size = 11, + base_family = "", + base_line_size = base_size/22, + base_rect_size = base_size/22 +) + +theme_light( + base_size = 11, + base_family = "", + base_line_size = base_size/22, + base_rect_size = base_size/22 +) + +theme_dark( + base_size = 11, + base_family = "", + base_line_size = base_size/22, + base_rect_size = base_size/22 +) + +theme_minimal( + base_size = 11, + base_family = "", + base_line_size = base_size/22, + base_rect_size = base_size/22 +) + +theme_classic( + base_size = 11, + base_family = "", + base_line_size = base_size/22, + base_rect_size = base_size/22 +) + +theme_void( + base_size = 11, + base_family = "", + base_line_size = base_size/22, + base_rect_size = base_size/22 +) + +theme_test( + base_size = 11, + base_family = "", + base_line_size = base_size/22, + base_rect_size = base_size/22 +) } \arguments{ \item{base_size}{base font size} diff --git a/man/guide_axis.Rd b/man/guide_axis.Rd index dbd206aaa5..019f661a51 100644 --- a/man/guide_axis.Rd +++ b/man/guide_axis.Rd @@ -4,8 +4,14 @@ \alias{guide_axis} \title{Axis guide} \usage{ -guide_axis(title = waiver(), check.overlap = FALSE, angle = NULL, - n.dodge = 1, order = 0, position = waiver()) +guide_axis( + title = waiver(), + check.overlap = FALSE, + angle = NULL, + n.dodge = 1, + order = 0, + position = waiver() +) } \arguments{ \item{title}{A character string or expression indicating a title of guide. diff --git a/man/guide_bins.Rd b/man/guide_bins.Rd index 13e0bce1fc..87283e144d 100644 --- a/man/guide_bins.Rd +++ b/man/guide_bins.Rd @@ -4,14 +4,31 @@ \alias{guide_bins} \title{A binned version of guide_legend} \usage{ -guide_bins(title = waiver(), title.position = NULL, - title.theme = NULL, title.hjust = NULL, title.vjust = NULL, - label = TRUE, label.position = NULL, label.theme = NULL, - label.hjust = NULL, label.vjust = NULL, keywidth = NULL, - keyheight = NULL, axis = TRUE, axis.colour = "black", - axis.linewidth = 0.5, axis.arrow = NULL, direction = NULL, - default.unit = "line", override.aes = list(), reverse = FALSE, - order = 0, show.limits = NULL, ...) +guide_bins( + title = waiver(), + title.position = NULL, + title.theme = NULL, + title.hjust = NULL, + title.vjust = NULL, + label = TRUE, + label.position = NULL, + label.theme = NULL, + label.hjust = NULL, + label.vjust = NULL, + keywidth = NULL, + keyheight = NULL, + axis = TRUE, + axis.colour = "black", + axis.linewidth = 0.5, + axis.arrow = NULL, + direction = NULL, + default.unit = "line", + override.aes = list(), + reverse = FALSE, + order = 0, + show.limits = NULL, + ... +) } \arguments{ \item{title}{A character string or expression indicating a title of guide. @@ -123,8 +140,10 @@ ggplot(mtcars) + } \seealso{ -Other guides: \code{\link{guide_colourbar}}, - \code{\link{guide_coloursteps}}, - \code{\link{guide_legend}}, \code{\link{guides}} +Other guides: +\code{\link{guide_colourbar}()}, +\code{\link{guide_coloursteps}()}, +\code{\link{guide_legend}()}, +\code{\link{guides}()} } \concept{guides} diff --git a/man/guide_colourbar.Rd b/man/guide_colourbar.Rd index c256aa30f6..7187f71a15 100644 --- a/man/guide_colourbar.Rd +++ b/man/guide_colourbar.Rd @@ -5,27 +5,67 @@ \alias{guide_colorbar} \title{Continuous colour bar guide} \usage{ -guide_colourbar(title = waiver(), title.position = NULL, - title.theme = NULL, title.hjust = NULL, title.vjust = NULL, - label = TRUE, label.position = NULL, label.theme = NULL, - label.hjust = NULL, label.vjust = NULL, barwidth = NULL, - barheight = NULL, nbin = 300, raster = TRUE, frame.colour = NULL, - frame.linewidth = 0.5, frame.linetype = 1, ticks = TRUE, - ticks.colour = "white", ticks.linewidth = 0.5, draw.ulim = TRUE, - draw.llim = TRUE, direction = NULL, default.unit = "line", - reverse = FALSE, order = 0, available_aes = c("colour", "color", - "fill"), ...) - -guide_colorbar(title = waiver(), title.position = NULL, - title.theme = NULL, title.hjust = NULL, title.vjust = NULL, - label = TRUE, label.position = NULL, label.theme = NULL, - label.hjust = NULL, label.vjust = NULL, barwidth = NULL, - barheight = NULL, nbin = 300, raster = TRUE, frame.colour = NULL, - frame.linewidth = 0.5, frame.linetype = 1, ticks = TRUE, - ticks.colour = "white", ticks.linewidth = 0.5, draw.ulim = TRUE, - draw.llim = TRUE, direction = NULL, default.unit = "line", - reverse = FALSE, order = 0, available_aes = c("colour", "color", - "fill"), ...) +guide_colourbar( + title = waiver(), + title.position = NULL, + title.theme = NULL, + title.hjust = NULL, + title.vjust = NULL, + label = TRUE, + label.position = NULL, + label.theme = NULL, + label.hjust = NULL, + label.vjust = NULL, + barwidth = NULL, + barheight = NULL, + nbin = 300, + raster = TRUE, + frame.colour = NULL, + frame.linewidth = 0.5, + frame.linetype = 1, + ticks = TRUE, + ticks.colour = "white", + ticks.linewidth = 0.5, + draw.ulim = TRUE, + draw.llim = TRUE, + direction = NULL, + default.unit = "line", + reverse = FALSE, + order = 0, + available_aes = c("colour", "color", "fill"), + ... +) + +guide_colorbar( + title = waiver(), + title.position = NULL, + title.theme = NULL, + title.hjust = NULL, + title.vjust = NULL, + label = TRUE, + label.position = NULL, + label.theme = NULL, + label.hjust = NULL, + label.vjust = NULL, + barwidth = NULL, + barheight = NULL, + nbin = 300, + raster = TRUE, + frame.colour = NULL, + frame.linewidth = 0.5, + frame.linetype = 1, + ticks = TRUE, + ticks.colour = "white", + ticks.linewidth = 0.5, + draw.ulim = TRUE, + draw.llim = TRUE, + direction = NULL, + default.unit = "line", + reverse = FALSE, + order = 0, + available_aes = c("colour", "color", "fill"), + ... +) } \arguments{ \item{title}{A character string or expression indicating a title of guide. @@ -131,8 +171,8 @@ For more information, see the inspiration for this function: \href{http://www.mathworks.com/help/techdoc/ref/colorbar.html}{Matlab's colorbar function}. } \details{ -Guides can be specified in each \code{scale_*} or in \code{\link[=guides]{guides()}}. -\code{guide="legend"} in \code{scale_*} is syntactic sugar for +Guides can be specified in each \verb{scale_*} or in \code{\link[=guides]{guides()}}. +\code{guide="legend"} in \verb{scale_*} is syntactic sugar for \code{guide=guide_legend()} (e.g. \code{scale_colour_manual(guide = "legend")}). As for how to specify the guide for each scale in more detail, see \code{\link[=guides]{guides()}}. @@ -186,8 +226,10 @@ p2 + scale_size(guide = guide_legend(direction = "vertical")) } \seealso{ -Other guides: \code{\link{guide_bins}}, - \code{\link{guide_coloursteps}}, - \code{\link{guide_legend}}, \code{\link{guides}} +Other guides: +\code{\link{guide_bins}()}, +\code{\link{guide_coloursteps}()}, +\code{\link{guide_legend}()}, +\code{\link{guides}()} } \concept{guides} diff --git a/man/guide_coloursteps.Rd b/man/guide_coloursteps.Rd index dd73dfff61..b3ea07afa7 100644 --- a/man/guide_coloursteps.Rd +++ b/man/guide_coloursteps.Rd @@ -5,11 +5,9 @@ \alias{guide_colorsteps} \title{Discretized colourbar guide} \usage{ -guide_coloursteps(even.steps = TRUE, show.limits = NULL, - ticks = FALSE, ...) +guide_coloursteps(even.steps = TRUE, show.limits = NULL, ticks = FALSE, ...) -guide_colorsteps(even.steps = TRUE, show.limits = NULL, - ticks = FALSE, ...) +guide_colorsteps(even.steps = TRUE, show.limits = NULL, ticks = FALSE, ...) } \arguments{ \item{even.steps}{Should the rendered size of the bins be equal, or should @@ -21,63 +19,64 @@ Default is \code{NULL} which makes the guide use the setting from the scale} \item{ticks}{A logical specifying if tick marks on the colourbar should be visible.} -\item{...}{Arguments passed on to \code{guide_colourbar} -\describe{ - \item{barwidth}{A numeric or a \code{\link[grid:unit]{grid::unit()}} object specifying +\item{...}{ + Arguments passed on to \code{\link[=guide_colourbar]{guide_colourbar}} + \describe{ + \item{\code{barwidth}}{A numeric or a \code{\link[grid:unit]{grid::unit()}} object specifying the width of the colourbar. Default value is \code{legend.key.width} or \code{legend.key.size} in \code{\link[=theme]{theme()}} or theme.} - \item{barheight}{A numeric or a \code{\link[grid:unit]{grid::unit()}} object specifying + \item{\code{barheight}}{A numeric or a \code{\link[grid:unit]{grid::unit()}} object specifying the height of the colourbar. Default value is \code{legend.key.height} or \code{legend.key.size} in \code{\link[=theme]{theme()}} or theme.} - \item{frame.colour}{A string specifying the colour of the frame + \item{\code{frame.colour}}{A string specifying the colour of the frame drawn around the bar. If \code{NULL} (the default), no frame is drawn.} - \item{frame.linewidth}{A numeric specifying the width of the frame + \item{\code{frame.linewidth}}{A numeric specifying the width of the frame drawn around the bar.} - \item{frame.linetype}{A numeric specifying the linetype of the frame + \item{\code{frame.linetype}}{A numeric specifying the linetype of the frame drawn around the bar.} - \item{ticks.colour}{A string specifying the colour of the tick marks.} - \item{ticks.linewidth}{A numeric specifying the width of the tick marks.} - \item{draw.ulim}{A logical specifying if the upper limit tick marks should + \item{\code{ticks.colour}}{A string specifying the colour of the tick marks.} + \item{\code{ticks.linewidth}}{A numeric specifying the width of the tick marks.} + \item{\code{draw.ulim}}{A logical specifying if the upper limit tick marks should be visible.} - \item{draw.llim}{A logical specifying if the lower limit tick marks should + \item{\code{draw.llim}}{A logical specifying if the lower limit tick marks should be visible.} - \item{direction}{A character string indicating the direction of the guide. + \item{\code{direction}}{A character string indicating the direction of the guide. One of "horizontal" or "vertical."} - \item{default.unit}{A character string indicating \code{\link[grid:unit]{grid::unit()}} + \item{\code{default.unit}}{A character string indicating \code{\link[grid:unit]{grid::unit()}} for \code{barwidth} and \code{barheight}.} - \item{reverse}{logical. If \code{TRUE} the colourbar is reversed. By default, + \item{\code{reverse}}{logical. If \code{TRUE} the colourbar is reversed. By default, the highest value is on the top and the lowest value is on the bottom} - \item{title}{A character string or expression indicating a title of guide. + \item{\code{title}}{A character string or expression indicating a title of guide. If \code{NULL}, the title is not shown. By default (\code{\link[=waiver]{waiver()}}), the name of the scale object or the name specified in \code{\link[=labs]{labs()}} is used for the title.} - \item{title.position}{A character string indicating the position of a + \item{\code{title.position}}{A character string indicating the position of a title. One of "top" (default for a vertical guide), "bottom", "left" (default for a horizontal guide), or "right."} - \item{title.theme}{A theme object for rendering the title text. Usually the + \item{\code{title.theme}}{A theme object for rendering the title text. Usually the object of \code{\link[=element_text]{element_text()}} is expected. By default, the theme is specified by \code{legend.title} in \code{\link[=theme]{theme()}} or theme.} - \item{title.hjust}{A number specifying horizontal justification of the + \item{\code{title.hjust}}{A number specifying horizontal justification of the title text.} - \item{title.vjust}{A number specifying vertical justification of the title + \item{\code{title.vjust}}{A number specifying vertical justification of the title text.} - \item{label}{logical. If \code{TRUE} then the labels are drawn. If + \item{\code{label}}{logical. If \code{TRUE} then the labels are drawn. If \code{FALSE} then the labels are invisible.} - \item{label.position}{A character string indicating the position of a + \item{\code{label.position}}{A character string indicating the position of a label. One of "top", "bottom" (default for horizontal guide), "left", or "right" (default for vertical guide).} - \item{label.theme}{A theme object for rendering the label text. Usually the + \item{\code{label.theme}}{A theme object for rendering the label text. Usually the object of \code{\link[=element_text]{element_text()}} is expected. By default, the theme is specified by \code{legend.text} in \code{\link[=theme]{theme()}}.} - \item{label.hjust}{A numeric specifying horizontal justification of the + \item{\code{label.hjust}}{A numeric specifying horizontal justification of the label text.} - \item{label.vjust}{A numeric specifying vertical justification of the label + \item{\code{label.vjust}}{A numeric specifying vertical justification of the label text.} - \item{order}{positive integer less than 99 that specifies the order of + \item{\code{order}}{positive integer less than 99 that specifies the order of this guide among multiple guides. This controls the order in which multiple guides are displayed, not the contents of the guide itself. If 0 (default), the order is determined by a secret algorithm.} -}} + }} } \value{ A guide object @@ -113,8 +112,10 @@ p + scale_fill_binned(show.limits = TRUE) } \seealso{ -Other guides: \code{\link{guide_bins}}, - \code{\link{guide_colourbar}}, - \code{\link{guide_legend}}, \code{\link{guides}} +Other guides: +\code{\link{guide_bins}()}, +\code{\link{guide_colourbar}()}, +\code{\link{guide_legend}()}, +\code{\link{guides}()} } \concept{guides} diff --git a/man/guide_legend.Rd b/man/guide_legend.Rd index 7dadfbfc52..72b061be49 100644 --- a/man/guide_legend.Rd +++ b/man/guide_legend.Rd @@ -4,13 +4,29 @@ \alias{guide_legend} \title{Legend guide} \usage{ -guide_legend(title = waiver(), title.position = NULL, - title.theme = NULL, title.hjust = NULL, title.vjust = NULL, - label = TRUE, label.position = NULL, label.theme = NULL, - label.hjust = NULL, label.vjust = NULL, keywidth = NULL, - keyheight = NULL, direction = NULL, default.unit = "line", - override.aes = list(), nrow = NULL, ncol = NULL, byrow = FALSE, - reverse = FALSE, order = 0, ...) +guide_legend( + title = waiver(), + title.position = NULL, + title.theme = NULL, + title.hjust = NULL, + title.vjust = NULL, + label = TRUE, + label.position = NULL, + label.theme = NULL, + label.hjust = NULL, + label.vjust = NULL, + keywidth = NULL, + keyheight = NULL, + direction = NULL, + default.unit = "line", + override.aes = list(), + nrow = NULL, + ncol = NULL, + byrow = FALSE, + reverse = FALSE, + order = 0, + ... +) } \arguments{ \item{title}{A character string or expression indicating a title of guide. @@ -87,8 +103,8 @@ Legend type guide shows key (i.e., geoms) mapped onto values. Legend guides for various scales are integrated if possible. } \details{ -Guides can be specified in each \code{scale_*} or in \code{\link[=guides]{guides()}}. -\code{guide = "legend"} in \code{scale_*} is syntactic sugar for +Guides can be specified in each \verb{scale_*} or in \code{\link[=guides]{guides()}}. +\code{guide = "legend"} in \verb{scale_*} is syntactic sugar for \code{guide = guide_legend()} (e.g. \code{scale_color_manual(guide = "legend")}). As for how to specify the guide for each scale in more detail, see \code{\link[=guides]{guides()}}. @@ -157,8 +173,10 @@ p + guides(col = guide_legend(reverse = TRUE)) } } \seealso{ -Other guides: \code{\link{guide_bins}}, - \code{\link{guide_colourbar}}, - \code{\link{guide_coloursteps}}, \code{\link{guides}} +Other guides: +\code{\link{guide_bins}()}, +\code{\link{guide_colourbar}()}, +\code{\link{guide_coloursteps}()}, +\code{\link{guides}()} } \concept{guides} diff --git a/man/guides.Rd b/man/guides.Rd index 43928a73cd..9b4b64135a 100644 --- a/man/guides.Rd +++ b/man/guides.Rd @@ -68,9 +68,10 @@ ggplot(mpg, aes(displ, cty)) + } } \seealso{ -Other guides: \code{\link{guide_bins}}, - \code{\link{guide_colourbar}}, - \code{\link{guide_coloursteps}}, - \code{\link{guide_legend}} +Other guides: +\code{\link{guide_bins}()}, +\code{\link{guide_colourbar}()}, +\code{\link{guide_coloursteps}()}, +\code{\link{guide_legend}()} } \concept{guides} diff --git a/man/labeller.Rd b/man/labeller.Rd index 52ef1a196f..72088af40f 100644 --- a/man/labeller.Rd +++ b/man/labeller.Rd @@ -4,8 +4,14 @@ \alias{labeller} \title{Construct labelling specification} \usage{ -labeller(..., .rows = NULL, .cols = NULL, keep.as.numeric = NULL, - .multi_line = TRUE, .default = label_value) +labeller( + ..., + .rows = NULL, + .cols = NULL, + keep.as.numeric = NULL, + .multi_line = TRUE, + .default = label_value +) } \arguments{ \item{...}{Named arguments of the form \code{variable = diff --git a/man/labs.Rd b/man/labs.Rd index d258e51e71..af9ab7347e 100644 --- a/man/labs.Rd +++ b/man/labs.Rd @@ -7,8 +7,13 @@ \alias{ggtitle} \title{Modify axis, legend, and plot labels} \usage{ -labs(..., title = waiver(), subtitle = waiver(), caption = waiver(), - tag = waiver()) +labs( + ..., + title = waiver(), + subtitle = waiver(), + caption = waiver(), + tag = waiver() +) xlab(label) diff --git a/man/layer.Rd b/man/layer.Rd index 02a4d73e44..4b644afe36 100644 --- a/man/layer.Rd +++ b/man/layer.Rd @@ -4,10 +4,20 @@ \alias{layer} \title{Create a new layer} \usage{ -layer(geom = NULL, stat = NULL, data = NULL, mapping = NULL, - position = NULL, params = list(), inherit.aes = TRUE, - check.aes = TRUE, check.param = TRUE, show.legend = NA, - key_glyph = NULL, layer_class = Layer) +layer( + geom = NULL, + stat = NULL, + data = NULL, + mapping = NULL, + position = NULL, + params = list(), + inherit.aes = TRUE, + check.aes = TRUE, + check.param = TRUE, + show.legend = NA, + key_glyph = NULL, + layer_class = Layer +) } \arguments{ \item{geom}{The geometric object to use display the data} @@ -63,7 +73,7 @@ intended for ggplot2 internal use only.} } \description{ A layer is a combination of data, stat and geom with a potential position -adjustment. Usually layers are created using \code{geom_*} or \code{stat_*} +adjustment. Usually layers are created using \verb{geom_*} or \verb{stat_*} calls but it can also be created directly using this function. } \examples{ diff --git a/man/layer_sf.Rd b/man/layer_sf.Rd index 7ede6671f8..9fc484e0fb 100644 --- a/man/layer_sf.Rd +++ b/man/layer_sf.Rd @@ -4,9 +4,18 @@ \alias{layer_sf} \title{Create a new sf layer that auto-maps geometry data} \usage{ -layer_sf(geom = NULL, stat = NULL, data = NULL, mapping = NULL, - position = NULL, params = list(), inherit.aes = TRUE, - check.aes = TRUE, check.param = TRUE, show.legend = NA) +layer_sf( + geom = NULL, + stat = NULL, + data = NULL, + mapping = NULL, + position = NULL, + params = list(), + inherit.aes = TRUE, + check.aes = TRUE, + check.param = TRUE, + show.legend = NA +) } \arguments{ \item{geom}{The geometric object to use display the data} diff --git a/man/position_dodge.Rd b/man/position_dodge.Rd index a35191e4fa..34641e342f 100644 --- a/man/position_dodge.Rd +++ b/man/position_dodge.Rd @@ -7,8 +7,12 @@ \usage{ position_dodge(width = NULL, preserve = c("total", "single")) -position_dodge2(width = NULL, preserve = c("total", "single"), - padding = 0.1, reverse = FALSE) +position_dodge2( + width = NULL, + preserve = c("total", "single"), + padding = 0.1, + reverse = FALSE +) } \arguments{ \item{width}{Dodging width, when different to the width of the individual @@ -93,10 +97,11 @@ ggplot(mtcars, aes(factor(cyl), fill = factor(vs))) + geom_bar(position = position_dodge2(preserve = "total")) } \seealso{ -Other position adjustments: \code{\link{position_identity}}, - \code{\link{position_jitterdodge}}, - \code{\link{position_jitter}}, - \code{\link{position_nudge}}, - \code{\link{position_stack}} +Other position adjustments: +\code{\link{position_identity}()}, +\code{\link{position_jitterdodge}()}, +\code{\link{position_jitter}()}, +\code{\link{position_nudge}()}, +\code{\link{position_stack}()} } \concept{position adjustments} diff --git a/man/position_identity.Rd b/man/position_identity.Rd index 440e575682..4c841c26f0 100644 --- a/man/position_identity.Rd +++ b/man/position_identity.Rd @@ -10,10 +10,11 @@ position_identity() Don't adjust position } \seealso{ -Other position adjustments: \code{\link{position_dodge}}, - \code{\link{position_jitterdodge}}, - \code{\link{position_jitter}}, - \code{\link{position_nudge}}, - \code{\link{position_stack}} +Other position adjustments: +\code{\link{position_dodge}()}, +\code{\link{position_jitterdodge}()}, +\code{\link{position_jitter}()}, +\code{\link{position_nudge}()}, +\code{\link{position_stack}()} } \concept{position adjustments} diff --git a/man/position_jitter.Rd b/man/position_jitter.Rd index 16548f6496..be453d77bd 100644 --- a/man/position_jitter.Rd +++ b/man/position_jitter.Rd @@ -55,10 +55,11 @@ ggplot(mtcars, aes(am, vs)) + geom_point(position = jitter, color = "red", aes(am + 0.2, vs + 0.2)) } \seealso{ -Other position adjustments: \code{\link{position_dodge}}, - \code{\link{position_identity}}, - \code{\link{position_jitterdodge}}, - \code{\link{position_nudge}}, - \code{\link{position_stack}} +Other position adjustments: +\code{\link{position_dodge}()}, +\code{\link{position_identity}()}, +\code{\link{position_jitterdodge}()}, +\code{\link{position_nudge}()}, +\code{\link{position_stack}()} } \concept{position adjustments} diff --git a/man/position_jitterdodge.Rd b/man/position_jitterdodge.Rd index f543bb332a..5e31830ae8 100644 --- a/man/position_jitterdodge.Rd +++ b/man/position_jitterdodge.Rd @@ -4,8 +4,12 @@ \alias{position_jitterdodge} \title{Simultaneously dodge and jitter} \usage{ -position_jitterdodge(jitter.width = NULL, jitter.height = 0, - dodge.width = 0.75, seed = NA) +position_jitterdodge( + jitter.width = NULL, + jitter.height = 0, + dodge.width = 0.75, + seed = NA +) } \arguments{ \item{jitter.width}{degree of jitter in x direction. Defaults to 40\% of the @@ -37,10 +41,11 @@ ggplot(dsub, aes(x = cut, y = carat, fill = clarity)) + geom_point(pch = 21, position = position_jitterdodge()) } \seealso{ -Other position adjustments: \code{\link{position_dodge}}, - \code{\link{position_identity}}, - \code{\link{position_jitter}}, - \code{\link{position_nudge}}, - \code{\link{position_stack}} +Other position adjustments: +\code{\link{position_dodge}()}, +\code{\link{position_identity}()}, +\code{\link{position_jitter}()}, +\code{\link{position_nudge}()}, +\code{\link{position_stack}()} } \concept{position adjustments} diff --git a/man/position_nudge.Rd b/man/position_nudge.Rd index aaf735e236..959f47b144 100644 --- a/man/position_nudge.Rd +++ b/man/position_nudge.Rd @@ -35,10 +35,11 @@ ggplot(df, aes(x, y)) + geom_text(aes(label = y), nudge_y = -0.1) } \seealso{ -Other position adjustments: \code{\link{position_dodge}}, - \code{\link{position_identity}}, - \code{\link{position_jitterdodge}}, - \code{\link{position_jitter}}, - \code{\link{position_stack}} +Other position adjustments: +\code{\link{position_dodge}()}, +\code{\link{position_identity}()}, +\code{\link{position_jitterdodge}()}, +\code{\link{position_jitter}()}, +\code{\link{position_stack}()} } \concept{position adjustments} diff --git a/man/position_stack.Rd b/man/position_stack.Rd index 39ea363603..8b96821ff1 100644 --- a/man/position_stack.Rd +++ b/man/position_stack.Rd @@ -140,10 +140,11 @@ ggplot(data = df, aes(x, y, group = grp)) + See \code{\link[=geom_bar]{geom_bar()}} and \code{\link[=geom_area]{geom_area()}} for more examples. -Other position adjustments: \code{\link{position_dodge}}, - \code{\link{position_identity}}, - \code{\link{position_jitterdodge}}, - \code{\link{position_jitter}}, - \code{\link{position_nudge}} +Other position adjustments: +\code{\link{position_dodge}()}, +\code{\link{position_identity}()}, +\code{\link{position_jitterdodge}()}, +\code{\link{position_jitter}()}, +\code{\link{position_nudge}()} } \concept{position adjustments} diff --git a/man/print.ggproto.Rd b/man/print.ggproto.Rd index 971c1b84ea..2703f71a78 100644 --- a/man/print.ggproto.Rd +++ b/man/print.ggproto.Rd @@ -19,16 +19,16 @@ will be passed to it. Otherwise, these arguments are unused.} and inherited members. If \code{FALSE}, show the inheritance hierarchy.} } \description{ -If a ggproto object has a \code{$print} method, this will call that method. +If a ggproto object has a \verb{$print} method, this will call that method. Otherwise, it will print out the members of the object, and optionally, the members of the inherited objects. } \examples{ Dog <- ggproto( print = function(self, n) { - cat("Woof!\\n") + cat("Woof!\n") } ) Dog -cat(format(Dog), "\\n") +cat(format(Dog), "\n") } diff --git a/man/qplot.Rd b/man/qplot.Rd index ac5e00f8d9..2959fde721 100644 --- a/man/qplot.Rd +++ b/man/qplot.Rd @@ -5,15 +5,43 @@ \alias{quickplot} \title{Quick plot} \usage{ -qplot(x, y, ..., data, facets = NULL, margins = FALSE, geom = "auto", - xlim = c(NA, NA), ylim = c(NA, NA), log = "", main = NULL, - xlab = NULL, ylab = NULL, asp = NA, stat = NULL, - position = NULL) +qplot( + x, + y, + ..., + data, + facets = NULL, + margins = FALSE, + geom = "auto", + xlim = c(NA, NA), + ylim = c(NA, NA), + log = "", + main = NULL, + xlab = NULL, + ylab = NULL, + asp = NA, + stat = NULL, + position = NULL +) -quickplot(x, y, ..., data, facets = NULL, margins = FALSE, - geom = "auto", xlim = c(NA, NA), ylim = c(NA, NA), log = "", - main = NULL, xlab = NULL, ylab = NULL, asp = NA, stat = NULL, - position = NULL) +quickplot( + x, + y, + ..., + data, + facets = NULL, + margins = FALSE, + geom = "auto", + xlim = c(NA, NA), + ylim = c(NA, NA), + log = "", + main = NULL, + xlab = NULL, + ylab = NULL, + asp = NA, + stat = NULL, + position = NULL +) } \arguments{ \item{x, y, ...}{Aesthetics passed into each layer} diff --git a/man/reexports.Rd b/man/reexports.Rd index 40e42d5d1a..6a4e58dd9a 100644 --- a/man/reexports.Rd +++ b/man/reexports.Rd @@ -20,7 +20,7 @@ These objects are imported from other packages. Follow the links below to see their documentation. \describe{ - \item{grid}{\code{\link[grid]{unit}}, \code{\link[grid]{arrow}}} + \item{grid}{\code{\link[grid]{arrow}}, \code{\link[grid]{unit}}} \item{scales}{\code{\link[scales]{alpha}}} }} diff --git a/man/remove_missing.Rd b/man/remove_missing.Rd index 213beb73d9..bbf8f328cd 100644 --- a/man/remove_missing.Rd +++ b/man/remove_missing.Rd @@ -4,8 +4,7 @@ \alias{remove_missing} \title{Convenience function to remove missing values from a data.frame} \usage{ -remove_missing(df, na.rm = FALSE, vars = names(df), name = "", - finite = FALSE) +remove_missing(df, na.rm = FALSE, vars = names(df), name = "", finite = FALSE) } \arguments{ \item{df}{data.frame} diff --git a/man/scale_alpha.Rd b/man/scale_alpha.Rd index 93f1da10ca..d0bf35f640 100644 --- a/man/scale_alpha.Rd +++ b/man/scale_alpha.Rd @@ -42,11 +42,12 @@ p + scale_alpha("cylinders") p + scale_alpha(range = c(0.4, 0.8)) } \seealso{ -Other colour scales: \code{\link{scale_colour_brewer}}, - \code{\link{scale_colour_gradient}}, - \code{\link{scale_colour_grey}}, - \code{\link{scale_colour_hue}}, - \code{\link{scale_colour_steps}}, - \code{\link{scale_colour_viridis_d}} +Other colour scales: +\code{\link{scale_colour_brewer}()}, +\code{\link{scale_colour_gradient}()}, +\code{\link{scale_colour_grey}()}, +\code{\link{scale_colour_hue}()}, +\code{\link{scale_colour_steps}()}, +\code{\link{scale_colour_viridis_d}()} } \concept{colour scales} diff --git a/man/scale_binned.Rd b/man/scale_binned.Rd index 1227d3e7a1..39f2e48d3f 100644 --- a/man/scale_binned.Rd +++ b/man/scale_binned.Rd @@ -5,17 +5,37 @@ \alias{scale_y_binned} \title{Positional scales for binning continuous data (x & y)} \usage{ -scale_x_binned(name = waiver(), n.breaks = 10, nice.breaks = TRUE, - breaks = waiver(), labels = waiver(), limits = NULL, - expand = waiver(), oob = squish, na.value = NA_real_, - right = TRUE, show.limits = FALSE, trans = "identity", - position = "bottom") +scale_x_binned( + name = waiver(), + n.breaks = 10, + nice.breaks = TRUE, + breaks = waiver(), + labels = waiver(), + limits = NULL, + expand = waiver(), + oob = squish, + na.value = NA_real_, + right = TRUE, + show.limits = FALSE, + trans = "identity", + position = "bottom" +) -scale_y_binned(name = waiver(), n.breaks = 10, nice.breaks = TRUE, - breaks = waiver(), labels = waiver(), limits = NULL, - expand = waiver(), oob = squish, na.value = NA_real_, - right = TRUE, show.limits = FALSE, trans = "identity", - position = "left") +scale_y_binned( + name = waiver(), + n.breaks = 10, + nice.breaks = TRUE, + breaks = waiver(), + labels = waiver(), + limits = NULL, + expand = waiver(), + oob = squish, + na.value = NA_real_, + right = TRUE, + show.limits = FALSE, + trans = "identity", + position = "left" +) } \arguments{ \item{name}{The name of the scale. Used as the axis or legend title. If @@ -96,7 +116,7 @@ or the object itself. Built-in transformations include "asn", "atanh", A transformation object bundles together a transform, its inverse, and methods for generating breaks and labels. Transformation objects -are defined in the scales package, and are called \code{_trans} (e.g., +are defined in the scales package, and are called \verb{_trans} (e.g., \code{\link[scales:boxcox_trans]{scales::boxcox_trans()}}). You can create your own transformation with \code{\link[scales:trans_new]{scales::trans_new()}}.} @@ -116,8 +136,9 @@ ggplot(mtcars) + scale_x_binned() } \seealso{ -Other position scales: \code{\link{scale_x_continuous}}, - \code{\link{scale_x_date}}, - \code{\link{scale_x_discrete}} +Other position scales: +\code{\link{scale_x_continuous}()}, +\code{\link{scale_x_date}()}, +\code{\link{scale_x_discrete}()} } \concept{position scales} diff --git a/man/scale_brewer.Rd b/man/scale_brewer.Rd index dffed48fe3..9ca8358521 100644 --- a/man/scale_brewer.Rd +++ b/man/scale_brewer.Rd @@ -12,26 +12,65 @@ \alias{scale_color_fermenter} \title{Sequential, diverging and qualitative colour scales from colorbrewer.org} \usage{ -scale_colour_brewer(..., type = "seq", palette = 1, direction = 1, - aesthetics = "colour") - -scale_fill_brewer(..., type = "seq", palette = 1, direction = 1, - aesthetics = "fill") - -scale_colour_distiller(..., type = "seq", palette = 1, - direction = -1, values = NULL, space = "Lab", - na.value = "grey50", guide = "colourbar", aesthetics = "colour") - -scale_fill_distiller(..., type = "seq", palette = 1, direction = -1, - values = NULL, space = "Lab", na.value = "grey50", - guide = "colourbar", aesthetics = "fill") - -scale_colour_fermenter(..., type = "seq", palette = 1, - direction = -1, na.value = "grey50", guide = "coloursteps", - aesthetics = "colour") - -scale_fill_fermenter(..., type = "seq", palette = 1, direction = -1, - na.value = "grey50", guide = "coloursteps", aesthetics = "fill") +scale_colour_brewer( + ..., + type = "seq", + palette = 1, + direction = 1, + aesthetics = "colour" +) + +scale_fill_brewer( + ..., + type = "seq", + palette = 1, + direction = 1, + aesthetics = "fill" +) + +scale_colour_distiller( + ..., + type = "seq", + palette = 1, + direction = -1, + values = NULL, + space = "Lab", + na.value = "grey50", + guide = "colourbar", + aesthetics = "colour" +) + +scale_fill_distiller( + ..., + type = "seq", + palette = 1, + direction = -1, + values = NULL, + space = "Lab", + na.value = "grey50", + guide = "colourbar", + aesthetics = "fill" +) + +scale_colour_fermenter( + ..., + type = "seq", + palette = 1, + direction = -1, + na.value = "grey50", + guide = "coloursteps", + aesthetics = "colour" +) + +scale_fill_fermenter( + ..., + type = "seq", + palette = 1, + direction = -1, + na.value = "grey50", + guide = "coloursteps", + aesthetics = "fill" +) } \arguments{ \item{...}{Other arguments passed on to \code{\link[=discrete_scale]{discrete_scale()}}, \code{\link[=continuous_scale]{continuous_scale()}}, @@ -55,7 +94,7 @@ same time, via \code{aesthetics = c("colour", "fill")}.} \item{values}{if colours should not be evenly positioned along the gradient this vector gives the position (between 0 and 1) for each colour in the -\code{colours} vector. See \code{\link[=rescale]{rescale()}} for a convenience function +\code{colours} vector. See \code{\link[scales:rescale]{rescale()}} for a convenience function to map an arbitrary range to between 0 and 1.} \item{space}{colour space in which to calculate gradient. Must be "Lab" - @@ -101,7 +140,7 @@ dsamp <- diamonds[sample(nrow(diamonds), 1000), ] d + scale_colour_brewer() # Change scale label -d + scale_colour_brewer("Diamond\\nclarity") +d + scale_colour_brewer("Diamond\nclarity") # Select brewer palette to use, see ?scales::brewer_pal for more details d + scale_colour_brewer(palette = "Greens") @@ -131,11 +170,12 @@ v + scale_fill_fermenter() } \seealso{ -Other colour scales: \code{\link{scale_alpha}}, - \code{\link{scale_colour_gradient}}, - \code{\link{scale_colour_grey}}, - \code{\link{scale_colour_hue}}, - \code{\link{scale_colour_steps}}, - \code{\link{scale_colour_viridis_d}} +Other colour scales: +\code{\link{scale_alpha}()}, +\code{\link{scale_colour_gradient}()}, +\code{\link{scale_colour_grey}()}, +\code{\link{scale_colour_hue}()}, +\code{\link{scale_colour_steps}()}, +\code{\link{scale_colour_viridis_d}()} } \concept{colour scales} diff --git a/man/scale_colour_continuous.Rd b/man/scale_colour_continuous.Rd index a1b5753848..72718862c0 100644 --- a/man/scale_colour_continuous.Rd +++ b/man/scale_colour_continuous.Rd @@ -9,11 +9,15 @@ \alias{scale_color_binned} \title{Continuous and binned colour scales} \usage{ -scale_colour_continuous(..., - type = getOption("ggplot2.continuous.colour", default = "gradient")) +scale_colour_continuous( + ..., + type = getOption("ggplot2.continuous.colour", default = "gradient") +) -scale_fill_continuous(..., type = getOption("ggplot2.continuous.fill", - default = "gradient")) +scale_fill_continuous( + ..., + type = getOption("ggplot2.continuous.fill", default = "gradient") +) } \arguments{ \item{...}{Additional parameters passed on to the scale type} diff --git a/man/scale_continuous.Rd b/man/scale_continuous.Rd index 97847343ab..aa21f7ccdd 100644 --- a/man/scale_continuous.Rd +++ b/man/scale_continuous.Rd @@ -11,17 +11,37 @@ \alias{scale_y_sqrt} \title{Position scales for continuous data (x & y)} \usage{ -scale_x_continuous(name = waiver(), breaks = waiver(), - minor_breaks = waiver(), n.breaks = NULL, labels = waiver(), - limits = NULL, expand = waiver(), oob = censor, - na.value = NA_real_, trans = "identity", guide = waiver(), - position = "bottom", sec.axis = waiver()) - -scale_y_continuous(name = waiver(), breaks = waiver(), - minor_breaks = waiver(), n.breaks = NULL, labels = waiver(), - limits = NULL, expand = waiver(), oob = censor, - na.value = NA_real_, trans = "identity", guide = waiver(), - position = "left", sec.axis = waiver()) +scale_x_continuous( + name = waiver(), + breaks = waiver(), + minor_breaks = waiver(), + n.breaks = NULL, + labels = waiver(), + limits = NULL, + expand = waiver(), + oob = censor, + na.value = NA_real_, + trans = "identity", + guide = waiver(), + position = "bottom", + sec.axis = waiver() +) + +scale_y_continuous( + name = waiver(), + breaks = waiver(), + minor_breaks = waiver(), + n.breaks = NULL, + labels = waiver(), + limits = NULL, + expand = waiver(), + oob = censor, + na.value = NA_real_, + trans = "identity", + guide = waiver(), + position = "left", + sec.axis = waiver() +) scale_x_log10(...) @@ -114,7 +134,7 @@ or the object itself. Built-in transformations include "asn", "atanh", A transformation object bundles together a transform, its inverse, and methods for generating breaks and labels. Transformation objects -are defined in the scales package, and are called \code{_trans} (e.g., +are defined in the scales package, and are called \verb{_trans} (e.g., \code{\link[scales:boxcox_trans]{scales::boxcox_trans()}}). You can create your own transformation with \code{\link[scales:trans_new]{scales::trans_new()}}.} @@ -126,13 +146,13 @@ transformation with \code{\link[scales:trans_new]{scales::trans_new()}}.} \item{sec.axis}{\code{\link[=sec_axis]{sec_axis()}} is used to specify a secondary axis.} -\item{...}{Other arguments passed on to \code{scale_(x|y)_continuous()}} +\item{...}{Other arguments passed on to \verb{scale_(x|y)_continuous()}} } \description{ \code{scale_x_continuous()} and \code{scale_y_continuous()} are the default scales for continuous x and y aesthetics. There are three variants that set the \code{trans} argument for commonly used transformations: -\code{scale_*_log10()}, \code{scale_*_sqrt()} and \code{scale_*_reverse()}. +\verb{scale_*_log10()}, \verb{scale_*_sqrt()} and \verb{scale_*_reverse()}. } \details{ For simple manipulation of labels and limits, you may wish to use @@ -193,8 +213,9 @@ p1 + scale_y_continuous(trans = scales::reciprocal_trans()) } \seealso{ -Other position scales: \code{\link{scale_x_binned}}, - \code{\link{scale_x_date}}, - \code{\link{scale_x_discrete}} +Other position scales: +\code{\link{scale_x_binned}()}, +\code{\link{scale_x_date}()}, +\code{\link{scale_x_discrete}()} } \concept{position scales} diff --git a/man/scale_date.Rd b/man/scale_date.Rd index 8e0391d7ce..95776c620b 100644 --- a/man/scale_date.Rd +++ b/man/scale_date.Rd @@ -9,39 +9,95 @@ \alias{scale_y_time} \title{Position scales for date/time data} \usage{ -scale_x_date(name = waiver(), breaks = waiver(), - date_breaks = waiver(), labels = waiver(), date_labels = waiver(), - minor_breaks = waiver(), date_minor_breaks = waiver(), - limits = NULL, expand = waiver(), guide = waiver(), - position = "bottom", sec.axis = waiver()) - -scale_y_date(name = waiver(), breaks = waiver(), - date_breaks = waiver(), labels = waiver(), date_labels = waiver(), - minor_breaks = waiver(), date_minor_breaks = waiver(), - limits = NULL, expand = waiver(), guide = waiver(), - position = "left", sec.axis = waiver()) - -scale_x_datetime(name = waiver(), breaks = waiver(), - date_breaks = waiver(), labels = waiver(), date_labels = waiver(), - minor_breaks = waiver(), date_minor_breaks = waiver(), - timezone = NULL, limits = NULL, expand = waiver(), - guide = waiver(), position = "bottom", sec.axis = waiver()) - -scale_y_datetime(name = waiver(), breaks = waiver(), - date_breaks = waiver(), labels = waiver(), date_labels = waiver(), - minor_breaks = waiver(), date_minor_breaks = waiver(), - timezone = NULL, limits = NULL, expand = waiver(), - guide = waiver(), position = "left", sec.axis = waiver()) - -scale_x_time(name = waiver(), breaks = waiver(), - minor_breaks = waiver(), labels = waiver(), limits = NULL, - expand = waiver(), oob = censor, na.value = NA_real_, - guide = waiver(), position = "bottom", sec.axis = waiver()) - -scale_y_time(name = waiver(), breaks = waiver(), - minor_breaks = waiver(), labels = waiver(), limits = NULL, - expand = waiver(), oob = censor, na.value = NA_real_, - guide = waiver(), position = "left", sec.axis = waiver()) +scale_x_date( + name = waiver(), + breaks = waiver(), + date_breaks = waiver(), + labels = waiver(), + date_labels = waiver(), + minor_breaks = waiver(), + date_minor_breaks = waiver(), + limits = NULL, + expand = waiver(), + guide = waiver(), + position = "bottom", + sec.axis = waiver() +) + +scale_y_date( + name = waiver(), + breaks = waiver(), + date_breaks = waiver(), + labels = waiver(), + date_labels = waiver(), + minor_breaks = waiver(), + date_minor_breaks = waiver(), + limits = NULL, + expand = waiver(), + guide = waiver(), + position = "left", + sec.axis = waiver() +) + +scale_x_datetime( + name = waiver(), + breaks = waiver(), + date_breaks = waiver(), + labels = waiver(), + date_labels = waiver(), + minor_breaks = waiver(), + date_minor_breaks = waiver(), + timezone = NULL, + limits = NULL, + expand = waiver(), + guide = waiver(), + position = "bottom", + sec.axis = waiver() +) + +scale_y_datetime( + name = waiver(), + breaks = waiver(), + date_breaks = waiver(), + labels = waiver(), + date_labels = waiver(), + minor_breaks = waiver(), + date_minor_breaks = waiver(), + timezone = NULL, + limits = NULL, + expand = waiver(), + guide = waiver(), + position = "left", + sec.axis = waiver() +) + +scale_x_time( + name = waiver(), + breaks = waiver(), + minor_breaks = waiver(), + labels = waiver(), + limits = NULL, + expand = waiver(), + oob = censor, + na.value = NA_real_, + guide = waiver(), + position = "bottom", + sec.axis = waiver() +) + +scale_y_time( + name = waiver(), + breaks = waiver(), + minor_breaks = waiver(), + labels = waiver(), + limits = NULL, + expand = waiver(), + oob = censor, + na.value = NA_real_, + guide = waiver(), + position = "left", + sec.axis = waiver() +) } \arguments{ \item{name}{The name of the scale. Used as the axis or legend title. If @@ -133,9 +189,9 @@ bounds values with \code{NA}. \description{ These are the default scales for the three date/time class. These will usually be added automatically. To override manually, use -\code{scale_*_date} for dates (class \code{Date}), -\code{scale_*_datetime} for datetimes (class \code{POSIXct}), and -\code{scale_*_time} for times (class \code{hms}). +\verb{scale_*_date} for dates (class \code{Date}), +\verb{scale_*_datetime} for datetimes (class \code{POSIXct}), and +\verb{scale_*_time} for times (class \code{hms}). } \examples{ last_month <- Sys.Date() - 0:29 @@ -160,8 +216,9 @@ base + scale_x_date(limits = c(Sys.Date() - 7, NA)) \seealso{ \code{\link[=sec_axis]{sec_axis()}} for how to specify secondary axes -Other position scales: \code{\link{scale_x_binned}}, - \code{\link{scale_x_continuous}}, - \code{\link{scale_x_discrete}} +Other position scales: +\code{\link{scale_x_binned}()}, +\code{\link{scale_x_continuous}()}, +\code{\link{scale_x_discrete}()} } \concept{position scales} diff --git a/man/scale_discrete.Rd b/man/scale_discrete.Rd index 3284d62b76..e5e323adae 100644 --- a/man/scale_discrete.Rd +++ b/man/scale_discrete.Rd @@ -5,19 +5,18 @@ \alias{scale_y_discrete} \title{Position scales for discrete data} \usage{ -scale_x_discrete(..., expand = waiver(), guide = waiver(), - position = "bottom") +scale_x_discrete(..., expand = waiver(), guide = waiver(), position = "bottom") -scale_y_discrete(..., expand = waiver(), guide = waiver(), - position = "left") +scale_y_discrete(..., expand = waiver(), guide = waiver(), position = "left") } \arguments{ -\item{...}{Arguments passed on to \code{discrete_scale} -\describe{ - \item{palette}{A palette function that when called with a single integer +\item{...}{ + Arguments passed on to \code{\link[=discrete_scale]{discrete_scale}} + \describe{ + \item{\code{palette}}{A palette function that when called with a single integer argument (the number of levels in the scale) returns the values that they should take (e.g., \code{\link[scales:hue_pal]{scales::hue_pal()}}).} - \item{breaks}{One of: + \item{\code{breaks}}{One of: \itemize{ \item \code{NULL} for no breaks \item \code{waiver()} for the default breaks (the scale limits) @@ -25,25 +24,25 @@ they should take (e.g., \code{\link[scales:hue_pal]{scales::hue_pal()}}).} \item A function that takes the limits as input and returns breaks as output }} - \item{limits}{A character vector that defines possible values of the scale + \item{\code{limits}}{A character vector that defines possible values of the scale and their order.} - \item{drop}{Should unused factor levels be omitted from the scale? + \item{\code{drop}}{Should unused factor levels be omitted from the scale? The default, \code{TRUE}, uses the levels that appear in the data; \code{FALSE} uses all the levels in the factor.} - \item{na.translate}{Unlike continuous scales, discrete scales can easily show + \item{\code{na.translate}}{Unlike continuous scales, discrete scales can easily show missing values, and do so by default. If you want to remove missing values from a discrete scale, specify \code{na.translate = FALSE}.} - \item{na.value}{If \code{na.translate = TRUE}, what value aesthetic + \item{\code{na.value}}{If \code{na.translate = TRUE}, what value aesthetic value should missing be displayed as? Does not apply to position scales where \code{NA} is always placed at the far right.} - \item{aesthetics}{The names of the aesthetics that this scale works with.} - \item{scale_name}{The name of the scale that should be used for error messages + \item{\code{aesthetics}}{The names of the aesthetics that this scale works with.} + \item{\code{scale_name}}{The name of the scale that should be used for error messages associated with this scale.} - \item{name}{The name of the scale. Used as the axis or legend title. If + \item{\code{name}}{The name of the scale. Used as the axis or legend title. If \code{waiver()}, the default, the name of the scale is taken from the first mapping used for that aesthetic. If \code{NULL}, the legend title will be omitted.} - \item{labels}{One of: + \item{\code{labels}}{One of: \itemize{ \item \code{NULL} for no labels \item \code{waiver()} for the default labels computed by the @@ -52,18 +51,8 @@ transformation object \item A function that takes the breaks as input and returns labels as output }} - \item{expand}{For position scales, a vector of range expansion constants used to add some -padding around the data to ensure that they are placed some distance -away from the axes. Use the convenience function \code{\link[=expansion]{expansion()}} -to generate the values for the \code{expand} argument. The defaults are to -expand the scale by 5\% on each side for continuous variables, and by -0.6 units on each side for discrete variables.} - \item{guide}{A function used to create a guide or its name. See -\code{\link[=guides]{guides()}} for more information.} - \item{position}{For position scales, The position of the axis. -\code{left} or \code{right} for y axes, \code{top} or \code{bottom} for x axes.} - \item{super}{The super class to use for the constructed scale} -}} + \item{\code{super}}{The super class to use for the constructed scale} + }} \item{expand}{For position scales, a vector of range expansion constants used to add some padding around the data to ensure that they are placed some distance @@ -124,8 +113,9 @@ ggplot(mpg, aes(reorder(manufacturer, displ), cty)) + } } \seealso{ -Other position scales: \code{\link{scale_x_binned}}, - \code{\link{scale_x_continuous}}, - \code{\link{scale_x_date}} +Other position scales: +\code{\link{scale_x_binned}()}, +\code{\link{scale_x_continuous}()}, +\code{\link{scale_x_date}()} } \concept{position scales} diff --git a/man/scale_gradient.Rd b/man/scale_gradient.Rd index 78793514a7..c565436b59 100644 --- a/man/scale_gradient.Rd +++ b/man/scale_gradient.Rd @@ -18,43 +18,86 @@ \alias{scale_color_gradientn} \title{Gradient colour scales} \usage{ -scale_colour_gradient(..., low = "#132B43", high = "#56B1F7", - space = "Lab", na.value = "grey50", guide = "colourbar", - aesthetics = "colour") +scale_colour_gradient( + ..., + low = "#132B43", + high = "#56B1F7", + space = "Lab", + na.value = "grey50", + guide = "colourbar", + aesthetics = "colour" +) -scale_fill_gradient(..., low = "#132B43", high = "#56B1F7", - space = "Lab", na.value = "grey50", guide = "colourbar", - aesthetics = "fill") +scale_fill_gradient( + ..., + low = "#132B43", + high = "#56B1F7", + space = "Lab", + na.value = "grey50", + guide = "colourbar", + aesthetics = "fill" +) -scale_colour_gradient2(..., low = muted("red"), mid = "white", - high = muted("blue"), midpoint = 0, space = "Lab", - na.value = "grey50", guide = "colourbar", aesthetics = "colour") +scale_colour_gradient2( + ..., + low = muted("red"), + mid = "white", + high = muted("blue"), + midpoint = 0, + space = "Lab", + na.value = "grey50", + guide = "colourbar", + aesthetics = "colour" +) -scale_fill_gradient2(..., low = muted("red"), mid = "white", - high = muted("blue"), midpoint = 0, space = "Lab", - na.value = "grey50", guide = "colourbar", aesthetics = "fill") +scale_fill_gradient2( + ..., + low = muted("red"), + mid = "white", + high = muted("blue"), + midpoint = 0, + space = "Lab", + na.value = "grey50", + guide = "colourbar", + aesthetics = "fill" +) -scale_colour_gradientn(..., colours, values = NULL, space = "Lab", - na.value = "grey50", guide = "colourbar", aesthetics = "colour", - colors) +scale_colour_gradientn( + ..., + colours, + values = NULL, + space = "Lab", + na.value = "grey50", + guide = "colourbar", + aesthetics = "colour", + colors +) -scale_fill_gradientn(..., colours, values = NULL, space = "Lab", - na.value = "grey50", guide = "colourbar", aesthetics = "fill", - colors) +scale_fill_gradientn( + ..., + colours, + values = NULL, + space = "Lab", + na.value = "grey50", + guide = "colourbar", + aesthetics = "fill", + colors +) } \arguments{ -\item{...}{Arguments passed on to \code{continuous_scale} -\describe{ - \item{scale_name}{The name of the scale that should be used for error messages +\item{...}{ + Arguments passed on to \code{\link[=continuous_scale]{continuous_scale}} + \describe{ + \item{\code{scale_name}}{The name of the scale that should be used for error messages associated with this scale.} - \item{palette}{A palette function that when called with a numeric vector with + \item{\code{palette}}{A palette function that when called with a numeric vector with values between 0 and 1 returns the corresponding output values (e.g., \code{\link[scales:area_pal]{scales::area_pal()}}).} - \item{name}{The name of the scale. Used as the axis or legend title. If + \item{\code{name}}{The name of the scale. Used as the axis or legend title. If \code{waiver()}, the default, the name of the scale is taken from the first mapping used for that aesthetic. If \code{NULL}, the legend title will be omitted.} - \item{breaks}{One of: + \item{\code{breaks}}{One of: \itemize{ \item \code{NULL} for no breaks \item \code{waiver()} for the default breaks computed by the @@ -63,7 +106,7 @@ omitted.} \item A function that takes the limits as input and returns breaks as output (e.g., a function returned by \code{\link[scales:extended_breaks]{scales::extended_breaks()}}) }} - \item{minor_breaks}{One of: + \item{\code{minor_breaks}}{One of: \itemize{ \item \code{NULL} for no minor breaks \item \code{waiver()} for the default breaks (one minor break between @@ -71,11 +114,11 @@ each major break) \item A numeric vector of positions \item A function that given the limits returns a vector of minor breaks. }} - \item{n.breaks}{An integer guiding the number of major breaks. The algorithm + \item{\code{n.breaks}}{An integer guiding the number of major breaks. The algorithm may choose a slightly different number to ensure nice break labels. Will only have an effect if \code{breaks = waiver()}. Use \code{NULL} to use the default number of breaks given by the transformation.} - \item{labels}{One of: + \item{\code{labels}}{One of: \itemize{ \item \code{NULL} for no labels \item \code{waiver()} for the default labels computed by the @@ -84,7 +127,7 @@ transformation object \item A function that takes the breaks as input and returns labels as output }} - \item{limits}{One of: + \item{\code{limits}}{One of: \itemize{ \item \code{NULL} to use the default scale range \item A numeric vector of length two providing limits of the scale. @@ -95,12 +138,12 @@ Note that setting limits on positional scales will \strong{remove} data outside If the purpose is to zoom, use the limit argument in the coordinate system (see \code{\link[=coord_cartesian]{coord_cartesian()}}). }} - \item{rescaler}{A function used to scale the input values to the + \item{\code{rescaler}}{A function used to scale the input values to the range [0, 1]. This is always \code{\link[scales:rescale]{scales::rescale()}}, except for diverging and n colour gradients (i.e., \code{\link[=scale_colour_gradient2]{scale_colour_gradient2()}}, \code{\link[=scale_colour_gradientn]{scale_colour_gradientn()}}). The \code{rescaler} is ignored by position scales, which ways use \code{\link[scales:rescale]{scales::rescale()}}.} - \item{oob}{One of: + \item{\code{oob}}{One of: \itemize{ \item Function that handles limits outside of the scale limits (out of bounds). @@ -109,7 +152,7 @@ bounds values with \code{NA}. \item \code{\link[scales:squish]{scales::squish()}} for squishing out of bounds values into range. \item \code{\link[scales:squish_infinite]{scales::squish_infinite()}} for squishing infitite values into range. }} - \item{trans}{For continuous scales, the name of a transformation object + \item{\code{trans}}{For continuous scales, the name of a transformation object or the object itself. Built-in transformations include "asn", "atanh", "boxcox", "date", "exp", "hms", "identity", "log", "log10", "log1p", "log2", "logit", "modulus", "probability", "probit", "pseudo_log", "reciprocal", @@ -117,19 +160,19 @@ or the object itself. Built-in transformations include "asn", "atanh", A transformation object bundles together a transform, its inverse, and methods for generating breaks and labels. Transformation objects -are defined in the scales package, and are called \code{_trans} (e.g., +are defined in the scales package, and are called \verb{_trans} (e.g., \code{\link[scales:boxcox_trans]{scales::boxcox_trans()}}). You can create your own transformation with \code{\link[scales:trans_new]{scales::trans_new()}}.} - \item{expand}{For position scales, a vector of range expansion constants used to add some + \item{\code{expand}}{For position scales, a vector of range expansion constants used to add some padding around the data to ensure that they are placed some distance away from the axes. Use the convenience function \code{\link[=expansion]{expansion()}} to generate the values for the \code{expand} argument. The defaults are to expand the scale by 5\% on each side for continuous variables, and by 0.6 units on each side for discrete variables.} - \item{position}{For position scales, The position of the axis. + \item{\code{position}}{For position scales, The position of the axis. \code{left} or \code{right} for y axes, \code{top} or \code{bottom} for x axes.} - \item{super}{The super class to use for the constructed scale} -}} + \item{\code{super}}{The super class to use for the constructed scale} + }} \item{low, high}{Colours for low and high ends of the gradient.} @@ -155,13 +198,13 @@ Defaults to 0.} \item{values}{if colours should not be evenly positioned along the gradient this vector gives the position (between 0 and 1) for each colour in the -\code{colours} vector. See \code{\link[=rescale]{rescale()}} for a convenience function +\code{colours} vector. See \code{\link[scales:rescale]{rescale()}} for a convenience function to map an arbitrary range to between 0 and 1.} } \description{ -\code{scale_*_gradient} creates a two colour gradient (low-high), -\code{scale_*_gradient2} creates a diverging colour gradient (low-mid-high), -\code{scale_*_gradientn} creates a n-colour gradient. +\verb{scale_*_gradient} creates a two colour gradient (low-high), +\verb{scale_*_gradient2} creates a diverging colour gradient (low-mid-high), +\verb{scale_*_gradientn} creates a n-colour gradient. } \details{ Default colours are generated with \pkg{munsell} and @@ -225,11 +268,12 @@ ggplot(df_na, aes(x = value, y)) + \code{\link[scales:seq_gradient_pal]{scales::seq_gradient_pal()}} for details on underlying palette -Other colour scales: \code{\link{scale_alpha}}, - \code{\link{scale_colour_brewer}}, - \code{\link{scale_colour_grey}}, - \code{\link{scale_colour_hue}}, - \code{\link{scale_colour_steps}}, - \code{\link{scale_colour_viridis_d}} +Other colour scales: +\code{\link{scale_alpha}()}, +\code{\link{scale_colour_brewer}()}, +\code{\link{scale_colour_grey}()}, +\code{\link{scale_colour_hue}()}, +\code{\link{scale_colour_steps}()}, +\code{\link{scale_colour_viridis_d}()} } \concept{colour scales} diff --git a/man/scale_grey.Rd b/man/scale_grey.Rd index 3e55326b3e..a8b8b3e9e4 100644 --- a/man/scale_grey.Rd +++ b/man/scale_grey.Rd @@ -6,19 +6,30 @@ \alias{scale_color_grey} \title{Sequential grey colour scales} \usage{ -scale_colour_grey(..., start = 0.2, end = 0.8, na.value = "red", - aesthetics = "colour") +scale_colour_grey( + ..., + start = 0.2, + end = 0.8, + na.value = "red", + aesthetics = "colour" +) -scale_fill_grey(..., start = 0.2, end = 0.8, na.value = "red", - aesthetics = "fill") +scale_fill_grey( + ..., + start = 0.2, + end = 0.8, + na.value = "red", + aesthetics = "fill" +) } \arguments{ -\item{...}{Arguments passed on to \code{discrete_scale} -\describe{ - \item{palette}{A palette function that when called with a single integer +\item{...}{ + Arguments passed on to \code{\link[=discrete_scale]{discrete_scale}} + \describe{ + \item{\code{palette}}{A palette function that when called with a single integer argument (the number of levels in the scale) returns the values that they should take (e.g., \code{\link[scales:hue_pal]{scales::hue_pal()}}).} - \item{breaks}{One of: + \item{\code{breaks}}{One of: \itemize{ \item \code{NULL} for no breaks \item \code{waiver()} for the default breaks (the scale limits) @@ -26,25 +37,21 @@ they should take (e.g., \code{\link[scales:hue_pal]{scales::hue_pal()}}).} \item A function that takes the limits as input and returns breaks as output }} - \item{limits}{A character vector that defines possible values of the scale + \item{\code{limits}}{A character vector that defines possible values of the scale and their order.} - \item{drop}{Should unused factor levels be omitted from the scale? + \item{\code{drop}}{Should unused factor levels be omitted from the scale? The default, \code{TRUE}, uses the levels that appear in the data; \code{FALSE} uses all the levels in the factor.} - \item{na.translate}{Unlike continuous scales, discrete scales can easily show + \item{\code{na.translate}}{Unlike continuous scales, discrete scales can easily show missing values, and do so by default. If you want to remove missing values from a discrete scale, specify \code{na.translate = FALSE}.} - \item{na.value}{If \code{na.translate = TRUE}, what value aesthetic -value should missing be displayed as? Does not apply to position scales -where \code{NA} is always placed at the far right.} - \item{aesthetics}{The names of the aesthetics that this scale works with.} - \item{scale_name}{The name of the scale that should be used for error messages + \item{\code{scale_name}}{The name of the scale that should be used for error messages associated with this scale.} - \item{name}{The name of the scale. Used as the axis or legend title. If + \item{\code{name}}{The name of the scale. Used as the axis or legend title. If \code{waiver()}, the default, the name of the scale is taken from the first mapping used for that aesthetic. If \code{NULL}, the legend title will be omitted.} - \item{labels}{One of: + \item{\code{labels}}{One of: \itemize{ \item \code{NULL} for no labels \item \code{waiver()} for the default labels computed by the @@ -53,18 +60,18 @@ transformation object \item A function that takes the breaks as input and returns labels as output }} - \item{expand}{For position scales, a vector of range expansion constants used to add some + \item{\code{expand}}{For position scales, a vector of range expansion constants used to add some padding around the data to ensure that they are placed some distance away from the axes. Use the convenience function \code{\link[=expansion]{expansion()}} to generate the values for the \code{expand} argument. The defaults are to expand the scale by 5\% on each side for continuous variables, and by 0.6 units on each side for discrete variables.} - \item{guide}{A function used to create a guide or its name. See + \item{\code{guide}}{A function used to create a guide or its name. See \code{\link[=guides]{guides()}} for more information.} - \item{position}{For position scales, The position of the axis. + \item{\code{position}}{For position scales, The position of the axis. \code{left} or \code{right} for y axes, \code{top} or \code{bottom} for x axes.} - \item{super}{The super class to use for the constructed scale} -}} + \item{\code{super}}{The super class to use for the constructed scale} + }} \item{start}{grey value at low end of palette} @@ -99,11 +106,12 @@ ggplot(mtcars, aes(mpg, wt)) + scale_colour_grey(na.value = "green") } \seealso{ -Other colour scales: \code{\link{scale_alpha}}, - \code{\link{scale_colour_brewer}}, - \code{\link{scale_colour_gradient}}, - \code{\link{scale_colour_hue}}, - \code{\link{scale_colour_steps}}, - \code{\link{scale_colour_viridis_d}} +Other colour scales: +\code{\link{scale_alpha}()}, +\code{\link{scale_colour_brewer}()}, +\code{\link{scale_colour_gradient}()}, +\code{\link{scale_colour_hue}()}, +\code{\link{scale_colour_steps}()}, +\code{\link{scale_colour_viridis_d}()} } \concept{colour scales} diff --git a/man/scale_hue.Rd b/man/scale_hue.Rd index 6a5f5dcde5..42020cc375 100644 --- a/man/scale_hue.Rd +++ b/man/scale_hue.Rd @@ -9,21 +9,36 @@ \alias{scale_color_hue} \title{Evenly spaced colours for discrete data} \usage{ -scale_colour_hue(..., h = c(0, 360) + 15, c = 100, l = 65, - h.start = 0, direction = 1, na.value = "grey50", - aesthetics = "colour") +scale_colour_hue( + ..., + h = c(0, 360) + 15, + c = 100, + l = 65, + h.start = 0, + direction = 1, + na.value = "grey50", + aesthetics = "colour" +) -scale_fill_hue(..., h = c(0, 360) + 15, c = 100, l = 65, - h.start = 0, direction = 1, na.value = "grey50", - aesthetics = "fill") +scale_fill_hue( + ..., + h = c(0, 360) + 15, + c = 100, + l = 65, + h.start = 0, + direction = 1, + na.value = "grey50", + aesthetics = "fill" +) } \arguments{ -\item{...}{Arguments passed on to \code{discrete_scale} -\describe{ - \item{palette}{A palette function that when called with a single integer +\item{...}{ + Arguments passed on to \code{\link[=discrete_scale]{discrete_scale}} + \describe{ + \item{\code{palette}}{A palette function that when called with a single integer argument (the number of levels in the scale) returns the values that they should take (e.g., \code{\link[scales:hue_pal]{scales::hue_pal()}}).} - \item{breaks}{One of: + \item{\code{breaks}}{One of: \itemize{ \item \code{NULL} for no breaks \item \code{waiver()} for the default breaks (the scale limits) @@ -31,24 +46,21 @@ they should take (e.g., \code{\link[scales:hue_pal]{scales::hue_pal()}}).} \item A function that takes the limits as input and returns breaks as output }} - \item{limits}{A character vector that defines possible values of the scale + \item{\code{limits}}{A character vector that defines possible values of the scale and their order.} - \item{drop}{Should unused factor levels be omitted from the scale? + \item{\code{drop}}{Should unused factor levels be omitted from the scale? The default, \code{TRUE}, uses the levels that appear in the data; \code{FALSE} uses all the levels in the factor.} - \item{na.translate}{Unlike continuous scales, discrete scales can easily show + \item{\code{na.translate}}{Unlike continuous scales, discrete scales can easily show missing values, and do so by default. If you want to remove missing values from a discrete scale, specify \code{na.translate = FALSE}.} - \item{na.value}{If \code{na.translate = TRUE}, what value aesthetic -value should missing be displayed as? Does not apply to position scales -where \code{NA} is always placed at the far right.} - \item{scale_name}{The name of the scale that should be used for error messages + \item{\code{scale_name}}{The name of the scale that should be used for error messages associated with this scale.} - \item{name}{The name of the scale. Used as the axis or legend title. If + \item{\code{name}}{The name of the scale. Used as the axis or legend title. If \code{waiver()}, the default, the name of the scale is taken from the first mapping used for that aesthetic. If \code{NULL}, the legend title will be omitted.} - \item{labels}{One of: + \item{\code{labels}}{One of: \itemize{ \item \code{NULL} for no labels \item \code{waiver()} for the default labels computed by the @@ -57,18 +69,18 @@ transformation object \item A function that takes the breaks as input and returns labels as output }} - \item{expand}{For position scales, a vector of range expansion constants used to add some + \item{\code{expand}}{For position scales, a vector of range expansion constants used to add some padding around the data to ensure that they are placed some distance away from the axes. Use the convenience function \code{\link[=expansion]{expansion()}} to generate the values for the \code{expand} argument. The defaults are to expand the scale by 5\% on each side for continuous variables, and by 0.6 units on each side for discrete variables.} - \item{guide}{A function used to create a guide or its name. See + \item{\code{guide}}{A function used to create a guide or its name. See \code{\link[=guides]{guides()}} for more information.} - \item{position}{For position scales, The position of the axis. + \item{\code{position}}{For position scales, The position of the axis. \code{left} or \code{right} for y axes, \code{top} or \code{bottom} for x axes.} - \item{super}{The super class to use for the constructed scale} -}} + \item{\code{super}}{The super class to use for the constructed scale} + }} \item{h}{range of hues to use, in [0, 360]} @@ -132,11 +144,12 @@ ggplot(mtcars, aes(mpg, wt)) + } } \seealso{ -Other colour scales: \code{\link{scale_alpha}}, - \code{\link{scale_colour_brewer}}, - \code{\link{scale_colour_gradient}}, - \code{\link{scale_colour_grey}}, - \code{\link{scale_colour_steps}}, - \code{\link{scale_colour_viridis_d}} +Other colour scales: +\code{\link{scale_alpha}()}, +\code{\link{scale_colour_brewer}()}, +\code{\link{scale_colour_gradient}()}, +\code{\link{scale_colour_grey}()}, +\code{\link{scale_colour_steps}()}, +\code{\link{scale_colour_viridis_d}()} } \concept{colour scales} diff --git a/man/scale_linetype.Rd b/man/scale_linetype.Rd index 2a82557802..e8c4ec46b7 100644 --- a/man/scale_linetype.Rd +++ b/man/scale_linetype.Rd @@ -16,12 +16,13 @@ scale_linetype_continuous(...) scale_linetype_discrete(..., na.value = "blank") } \arguments{ -\item{...}{Arguments passed on to \code{discrete_scale} -\describe{ - \item{palette}{A palette function that when called with a single integer +\item{...}{ + Arguments passed on to \code{\link[=discrete_scale]{discrete_scale}} + \describe{ + \item{\code{palette}}{A palette function that when called with a single integer argument (the number of levels in the scale) returns the values that they should take (e.g., \code{\link[scales:hue_pal]{scales::hue_pal()}}).} - \item{breaks}{One of: + \item{\code{breaks}}{One of: \itemize{ \item \code{NULL} for no breaks \item \code{waiver()} for the default breaks (the scale limits) @@ -29,22 +30,22 @@ they should take (e.g., \code{\link[scales:hue_pal]{scales::hue_pal()}}).} \item A function that takes the limits as input and returns breaks as output }} - \item{limits}{A character vector that defines possible values of the scale + \item{\code{limits}}{A character vector that defines possible values of the scale and their order.} - \item{drop}{Should unused factor levels be omitted from the scale? + \item{\code{drop}}{Should unused factor levels be omitted from the scale? The default, \code{TRUE}, uses the levels that appear in the data; \code{FALSE} uses all the levels in the factor.} - \item{na.translate}{Unlike continuous scales, discrete scales can easily show + \item{\code{na.translate}}{Unlike continuous scales, discrete scales can easily show missing values, and do so by default. If you want to remove missing values from a discrete scale, specify \code{na.translate = FALSE}.} - \item{aesthetics}{The names of the aesthetics that this scale works with.} - \item{scale_name}{The name of the scale that should be used for error messages + \item{\code{aesthetics}}{The names of the aesthetics that this scale works with.} + \item{\code{scale_name}}{The name of the scale that should be used for error messages associated with this scale.} - \item{name}{The name of the scale. Used as the axis or legend title. If + \item{\code{name}}{The name of the scale. Used as the axis or legend title. If \code{waiver()}, the default, the name of the scale is taken from the first mapping used for that aesthetic. If \code{NULL}, the legend title will be omitted.} - \item{labels}{One of: + \item{\code{labels}}{One of: \itemize{ \item \code{NULL} for no labels \item \code{waiver()} for the default labels computed by the @@ -53,10 +54,10 @@ transformation object \item A function that takes the breaks as input and returns labels as output }} - \item{guide}{A function used to create a guide or its name. See + \item{\code{guide}}{A function used to create a guide or its name. See \code{\link[=guides]{guides()}} for more information.} - \item{super}{The super class to use for the constructed scale} -}} + \item{\code{super}}{The super class to use for the constructed scale} + }} \item{na.value}{The linetype to use for \code{NA} values.} } diff --git a/man/scale_manual.Rd b/man/scale_manual.Rd index 9f0df47334..62bbd61e1b 100644 --- a/man/scale_manual.Rd +++ b/man/scale_manual.Rd @@ -26,12 +26,13 @@ scale_alpha_manual(..., values) scale_discrete_manual(aesthetics, ..., values) } \arguments{ -\item{...}{Arguments passed on to \code{discrete_scale} -\describe{ - \item{palette}{A palette function that when called with a single integer +\item{...}{ + Arguments passed on to \code{\link[=discrete_scale]{discrete_scale}} + \describe{ + \item{\code{palette}}{A palette function that when called with a single integer argument (the number of levels in the scale) returns the values that they should take (e.g., \code{\link[scales:hue_pal]{scales::hue_pal()}}).} - \item{breaks}{One of: + \item{\code{breaks}}{One of: \itemize{ \item \code{NULL} for no breaks \item \code{waiver()} for the default breaks (the scale limits) @@ -39,24 +40,24 @@ they should take (e.g., \code{\link[scales:hue_pal]{scales::hue_pal()}}).} \item A function that takes the limits as input and returns breaks as output }} - \item{limits}{A character vector that defines possible values of the scale + \item{\code{limits}}{A character vector that defines possible values of the scale and their order.} - \item{drop}{Should unused factor levels be omitted from the scale? + \item{\code{drop}}{Should unused factor levels be omitted from the scale? The default, \code{TRUE}, uses the levels that appear in the data; \code{FALSE} uses all the levels in the factor.} - \item{na.translate}{Unlike continuous scales, discrete scales can easily show + \item{\code{na.translate}}{Unlike continuous scales, discrete scales can easily show missing values, and do so by default. If you want to remove missing values from a discrete scale, specify \code{na.translate = FALSE}.} - \item{na.value}{If \code{na.translate = TRUE}, what value aesthetic + \item{\code{na.value}}{If \code{na.translate = TRUE}, what value aesthetic value should missing be displayed as? Does not apply to position scales where \code{NA} is always placed at the far right.} - \item{scale_name}{The name of the scale that should be used for error messages + \item{\code{scale_name}}{The name of the scale that should be used for error messages associated with this scale.} - \item{name}{The name of the scale. Used as the axis or legend title. If + \item{\code{name}}{The name of the scale. Used as the axis or legend title. If \code{waiver()}, the default, the name of the scale is taken from the first mapping used for that aesthetic. If \code{NULL}, the legend title will be omitted.} - \item{labels}{One of: + \item{\code{labels}}{One of: \itemize{ \item \code{NULL} for no labels \item \code{waiver()} for the default labels computed by the @@ -65,10 +66,10 @@ transformation object \item A function that takes the breaks as input and returns labels as output }} - \item{guide}{A function used to create a guide or its name. See + \item{\code{guide}}{A function used to create a guide or its name. See \code{\link[=guides]{guides()}} for more information.} - \item{super}{The super class to use for the constructed scale} -}} + \item{\code{super}}{The super class to use for the constructed scale} + }} \item{values}{a set of aesthetic values to map data values to. If this is a named vector, then the values will be matched based on the names. diff --git a/man/scale_shape.Rd b/man/scale_shape.Rd index 049aaf06ec..0c3ba1524c 100644 --- a/man/scale_shape.Rd +++ b/man/scale_shape.Rd @@ -13,12 +13,13 @@ scale_shape(..., solid = TRUE) scale_shape_binned(..., solid = TRUE) } \arguments{ -\item{...}{Arguments passed on to \code{discrete_scale} -\describe{ - \item{palette}{A palette function that when called with a single integer +\item{...}{ + Arguments passed on to \code{\link[=discrete_scale]{discrete_scale}} + \describe{ + \item{\code{palette}}{A palette function that when called with a single integer argument (the number of levels in the scale) returns the values that they should take (e.g., \code{\link[scales:hue_pal]{scales::hue_pal()}}).} - \item{breaks}{One of: + \item{\code{breaks}}{One of: \itemize{ \item \code{NULL} for no breaks \item \code{waiver()} for the default breaks (the scale limits) @@ -26,25 +27,25 @@ they should take (e.g., \code{\link[scales:hue_pal]{scales::hue_pal()}}).} \item A function that takes the limits as input and returns breaks as output }} - \item{limits}{A character vector that defines possible values of the scale + \item{\code{limits}}{A character vector that defines possible values of the scale and their order.} - \item{drop}{Should unused factor levels be omitted from the scale? + \item{\code{drop}}{Should unused factor levels be omitted from the scale? The default, \code{TRUE}, uses the levels that appear in the data; \code{FALSE} uses all the levels in the factor.} - \item{na.translate}{Unlike continuous scales, discrete scales can easily show + \item{\code{na.translate}}{Unlike continuous scales, discrete scales can easily show missing values, and do so by default. If you want to remove missing values from a discrete scale, specify \code{na.translate = FALSE}.} - \item{na.value}{If \code{na.translate = TRUE}, what value aesthetic + \item{\code{na.value}}{If \code{na.translate = TRUE}, what value aesthetic value should missing be displayed as? Does not apply to position scales where \code{NA} is always placed at the far right.} - \item{aesthetics}{The names of the aesthetics that this scale works with.} - \item{scale_name}{The name of the scale that should be used for error messages + \item{\code{aesthetics}}{The names of the aesthetics that this scale works with.} + \item{\code{scale_name}}{The name of the scale that should be used for error messages associated with this scale.} - \item{name}{The name of the scale. Used as the axis or legend title. If + \item{\code{name}}{The name of the scale. Used as the axis or legend title. If \code{waiver()}, the default, the name of the scale is taken from the first mapping used for that aesthetic. If \code{NULL}, the legend title will be omitted.} - \item{labels}{One of: + \item{\code{labels}}{One of: \itemize{ \item \code{NULL} for no labels \item \code{waiver()} for the default labels computed by the @@ -53,10 +54,10 @@ transformation object \item A function that takes the breaks as input and returns labels as output }} - \item{guide}{A function used to create a guide or its name. See + \item{\code{guide}}{A function used to create a guide or its name. See \code{\link[=guides]{guides()}} for more information.} - \item{super}{The super class to use for the constructed scale} -}} + \item{\code{super}}{The super class to use for the constructed scale} + }} \item{solid}{Should the shapes be solid, \code{TRUE}, or hollow, \code{FALSE}?} diff --git a/man/scale_size.Rd b/man/scale_size.Rd index 21bd612dfc..45eb3da925 100644 --- a/man/scale_size.Rd +++ b/man/scale_size.Rd @@ -13,18 +13,37 @@ \alias{scale_size_date} \title{Scales for area or radius} \usage{ -scale_size(name = waiver(), breaks = waiver(), labels = waiver(), - limits = NULL, range = c(1, 6), trans = "identity", - guide = "legend") - -scale_radius(name = waiver(), breaks = waiver(), labels = waiver(), - limits = NULL, range = c(1, 6), trans = "identity", - guide = "legend") - -scale_size_binned(name = waiver(), breaks = waiver(), - labels = waiver(), limits = NULL, range = c(1, 6), - n.breaks = NULL, nice.breaks = TRUE, trans = "identity", - guide = "bins") +scale_size( + name = waiver(), + breaks = waiver(), + labels = waiver(), + limits = NULL, + range = c(1, 6), + trans = "identity", + guide = "legend" +) + +scale_radius( + name = waiver(), + breaks = waiver(), + labels = waiver(), + limits = NULL, + range = c(1, 6), + trans = "identity", + guide = "legend" +) + +scale_size_binned( + name = waiver(), + breaks = waiver(), + labels = waiver(), + limits = NULL, + range = c(1, 6), + n.breaks = NULL, + nice.breaks = TRUE, + trans = "identity", + guide = "bins" +) scale_size_area(..., max_size = 6) @@ -79,7 +98,7 @@ or the object itself. Built-in transformations include "asn", "atanh", A transformation object bundles together a transform, its inverse, and methods for generating breaks and labels. Transformation objects -are defined in the scales package, and are called \code{_trans} (e.g., +are defined in the scales package, and are called \verb{_trans} (e.g., \code{\link[scales:boxcox_trans]{scales::boxcox_trans()}}). You can create your own transformation with \code{\link[scales:trans_new]{scales::trans_new()}}.} @@ -97,22 +116,10 @@ the scale will ask the transformation object to create breaks, and this may result in a different number of breaks than requested. Ignored if breaks are given explicetly.} -\item{...}{Arguments passed on to \code{continuous_scale} -\describe{ - \item{name}{The name of the scale. Used as the axis or legend title. If -\code{waiver()}, the default, the name of the scale is taken from the first -mapping used for that aesthetic. If \code{NULL}, the legend title will be -omitted.} - \item{breaks}{One of: -\itemize{ -\item \code{NULL} for no breaks -\item \code{waiver()} for the default breaks computed by the -\link[scales:trans_new]{transformation object} -\item A numeric vector of positions -\item A function that takes the limits as input and returns breaks -as output (e.g., a function returned by \code{\link[scales:extended_breaks]{scales::extended_breaks()}}) -}} - \item{minor_breaks}{One of: +\item{...}{ + Arguments passed on to \code{\link[=continuous_scale]{continuous_scale}} + \describe{ + \item{\code{minor_breaks}}{One of: \itemize{ \item \code{NULL} for no minor breaks \item \code{waiver()} for the default breaks (one minor break between @@ -120,31 +127,7 @@ each major break) \item A numeric vector of positions \item A function that given the limits returns a vector of minor breaks. }} - \item{n.breaks}{An integer guiding the number of major breaks. The algorithm -may choose a slightly different number to ensure nice break labels. Will -only have an effect if \code{breaks = waiver()}. Use \code{NULL} to use the default -number of breaks given by the transformation.} - \item{labels}{One of: -\itemize{ -\item \code{NULL} for no labels -\item \code{waiver()} for the default labels computed by the -transformation object -\item A character vector giving labels (must be same length as \code{breaks}) -\item A function that takes the breaks as input and returns labels -as output -}} - \item{limits}{One of: -\itemize{ -\item \code{NULL} to use the default scale range -\item A numeric vector of length two providing limits of the scale. -Use \code{NA} to refer to the existing minimum or maximum -\item A function that accepts the existing (automatic) limits and returns -new limits -Note that setting limits on positional scales will \strong{remove} data outside of the limits. -If the purpose is to zoom, use the limit argument in the coordinate system -(see \code{\link[=coord_cartesian]{coord_cartesian()}}). -}} - \item{oob}{One of: + \item{\code{oob}}{One of: \itemize{ \item Function that handles limits outside of the scale limits (out of bounds). @@ -153,30 +136,17 @@ bounds values with \code{NA}. \item \code{\link[scales:squish]{scales::squish()}} for squishing out of bounds values into range. \item \code{\link[scales:squish_infinite]{scales::squish_infinite()}} for squishing infitite values into range. }} - \item{na.value}{Missing values will be replaced with this value.} - \item{trans}{For continuous scales, the name of a transformation object -or the object itself. Built-in transformations include "asn", "atanh", -"boxcox", "date", "exp", "hms", "identity", "log", "log10", "log1p", "log2", -"logit", "modulus", "probability", "probit", "pseudo_log", "reciprocal", -"reverse", "sqrt" and "time". - -A transformation object bundles together a transform, its inverse, -and methods for generating breaks and labels. Transformation objects -are defined in the scales package, and are called \code{_trans} (e.g., -\code{\link[scales:boxcox_trans]{scales::boxcox_trans()}}). You can create your own -transformation with \code{\link[scales:trans_new]{scales::trans_new()}}.} - \item{guide}{A function used to create a guide or its name. See -\code{\link[=guides]{guides()}} for more information.} - \item{expand}{For position scales, a vector of range expansion constants used to add some + \item{\code{na.value}}{Missing values will be replaced with this value.} + \item{\code{expand}}{For position scales, a vector of range expansion constants used to add some padding around the data to ensure that they are placed some distance away from the axes. Use the convenience function \code{\link[=expansion]{expansion()}} to generate the values for the \code{expand} argument. The defaults are to expand the scale by 5\% on each side for continuous variables, and by 0.6 units on each side for discrete variables.} - \item{position}{For position scales, The position of the axis. + \item{\code{position}}{For position scales, The position of the axis. \code{left} or \code{right} for y axes, \code{top} or \code{bottom} for x axes.} - \item{super}{The super class to use for the constructed scale} -}} + \item{\code{super}}{The super class to use for the constructed scale} + }} \item{max_size}{Size of largest points.} } diff --git a/man/scale_steps.Rd b/man/scale_steps.Rd index 9155ee3357..343fd3a7c7 100644 --- a/man/scale_steps.Rd +++ b/man/scale_steps.Rd @@ -12,48 +12,91 @@ \alias{scale_color_stepsn} \title{Binned gradient colour scales} \usage{ -scale_colour_steps(..., low = "#132B43", high = "#56B1F7", - space = "Lab", na.value = "grey50", guide = "coloursteps", - aesthetics = "colour") +scale_colour_steps( + ..., + low = "#132B43", + high = "#56B1F7", + space = "Lab", + na.value = "grey50", + guide = "coloursteps", + aesthetics = "colour" +) -scale_colour_steps2(..., low = muted("red"), mid = "white", - high = muted("blue"), midpoint = 0, space = "Lab", - na.value = "grey50", guide = "coloursteps", aesthetics = "colour") +scale_colour_steps2( + ..., + low = muted("red"), + mid = "white", + high = muted("blue"), + midpoint = 0, + space = "Lab", + na.value = "grey50", + guide = "coloursteps", + aesthetics = "colour" +) -scale_colour_stepsn(..., colours, values = NULL, space = "Lab", - na.value = "grey50", guide = "coloursteps", aesthetics = "colour", - colors) +scale_colour_stepsn( + ..., + colours, + values = NULL, + space = "Lab", + na.value = "grey50", + guide = "coloursteps", + aesthetics = "colour", + colors +) -scale_fill_steps(..., low = "#132B43", high = "#56B1F7", - space = "Lab", na.value = "grey50", guide = "coloursteps", - aesthetics = "fill") +scale_fill_steps( + ..., + low = "#132B43", + high = "#56B1F7", + space = "Lab", + na.value = "grey50", + guide = "coloursteps", + aesthetics = "fill" +) -scale_fill_steps2(..., low = muted("red"), mid = "white", - high = muted("blue"), midpoint = 0, space = "Lab", - na.value = "grey50", guide = "coloursteps", aesthetics = "fill") +scale_fill_steps2( + ..., + low = muted("red"), + mid = "white", + high = muted("blue"), + midpoint = 0, + space = "Lab", + na.value = "grey50", + guide = "coloursteps", + aesthetics = "fill" +) -scale_fill_stepsn(..., colours, values = NULL, space = "Lab", - na.value = "grey50", guide = "coloursteps", aesthetics = "fill", - colors) +scale_fill_stepsn( + ..., + colours, + values = NULL, + space = "Lab", + na.value = "grey50", + guide = "coloursteps", + aesthetics = "fill", + colors +) } \arguments{ -\item{...}{Arguments passed on to \code{binned_scale} -\describe{ - \item{n.breaks}{The number of break points to create if breaks are not given +\item{...}{ + Arguments passed on to \code{\link[=binned_scale]{binned_scale}} + \describe{ + \item{\code{n.breaks}}{The number of break points to create if breaks are not given directly.} - \item{nice.breaks}{Logical. Should breaks be attempted placed at nice values + \item{\code{nice.breaks}}{Logical. Should breaks be attempted placed at nice values instead of exactly evenly spaced between the limits. If \code{TRUE} (default) the scale will ask the transformation object to create breaks, and this may result in a different number of breaks than requested. Ignored if breaks are given explicetly.} - \item{right}{Should values on the border between bins be part of the right + \item{\code{right}}{Should values on the border between bins be part of the right (upper) bin?} - \item{show.limits}{should the limits of the scale appear as ticks} - \item{name}{The name of the scale. Used as the axis or legend title. If + \item{\code{show.limits}}{should the limits of the scale appear as ticks} + \item{\code{name}}{The name of the scale. Used as the axis or legend title. If \code{waiver()}, the default, the name of the scale is taken from the first mapping used for that aesthetic. If \code{NULL}, the legend title will be omitted.} - \item{breaks}{One of: + \item{\code{breaks}}{One of: \itemize{ \item \code{NULL} for no breaks \item \code{waiver()} for the default breaks computed by the @@ -62,7 +105,7 @@ omitted.} \item A function that takes the limits as input and returns breaks as output (e.g., a function returned by \code{\link[scales:extended_breaks]{scales::extended_breaks()}}) }} - \item{labels}{One of: + \item{\code{labels}}{One of: \itemize{ \item \code{NULL} for no labels \item \code{waiver()} for the default labels computed by the @@ -71,7 +114,7 @@ transformation object \item A function that takes the breaks as input and returns labels as output }} - \item{limits}{One of: + \item{\code{limits}}{One of: \itemize{ \item \code{NULL} to use the default scale range \item A numeric vector of length two providing limits of the scale. @@ -82,7 +125,7 @@ Note that setting limits on positional scales will \strong{remove} data outside If the purpose is to zoom, use the limit argument in the coordinate system (see \code{\link[=coord_cartesian]{coord_cartesian()}}). }} - \item{oob}{One of: + \item{\code{oob}}{One of: \itemize{ \item Function that handles limits outside of the scale limits (out of bounds). @@ -91,13 +134,13 @@ bounds values with \code{NA}. \item \code{\link[scales:squish]{scales::squish()}} for squishing out of bounds values into range. \item \code{\link[scales:squish_infinite]{scales::squish_infinite()}} for squishing infitite values into range. }} - \item{expand}{For position scales, a vector of range expansion constants used to add some + \item{\code{expand}}{For position scales, a vector of range expansion constants used to add some padding around the data to ensure that they are placed some distance away from the axes. Use the convenience function \code{\link[=expansion]{expansion()}} to generate the values for the \code{expand} argument. The defaults are to expand the scale by 5\% on each side for continuous variables, and by 0.6 units on each side for discrete variables.} - \item{trans}{For continuous scales, the name of a transformation object + \item{\code{trans}}{For continuous scales, the name of a transformation object or the object itself. Built-in transformations include "asn", "atanh", "boxcox", "date", "exp", "hms", "identity", "log", "log10", "log1p", "log2", "logit", "modulus", "probability", "probit", "pseudo_log", "reciprocal", @@ -105,13 +148,13 @@ or the object itself. Built-in transformations include "asn", "atanh", A transformation object bundles together a transform, its inverse, and methods for generating breaks and labels. Transformation objects -are defined in the scales package, and are called \code{_trans} (e.g., +are defined in the scales package, and are called \verb{_trans} (e.g., \code{\link[scales:boxcox_trans]{scales::boxcox_trans()}}). You can create your own transformation with \code{\link[scales:trans_new]{scales::trans_new()}}.} - \item{position}{For position scales, The position of the axis. + \item{\code{position}}{For position scales, The position of the axis. \code{left} or \code{right} for y axes, \code{top} or \code{bottom} for x axes.} - \item{super}{The super class to use for the constructed scale} -}} + \item{\code{super}}{The super class to use for the constructed scale} + }} \item{low}{Colours for low and high ends of the gradient.} @@ -139,15 +182,15 @@ Defaults to 0.} \item{values}{if colours should not be evenly positioned along the gradient this vector gives the position (between 0 and 1) for each colour in the -\code{colours} vector. See \code{\link[=rescale]{rescale()}} for a convenience function +\code{colours} vector. See \code{\link[scales:rescale]{rescale()}} for a convenience function to map an arbitrary range to between 0 and 1.} \item{colors}{Vector of colours to use for n-colour gradient.} } \description{ -\code{scale_*_steps} creates a two colour binned gradient (low-high), -\code{scale_*_steps2} creates a diverging binned colour gradient (low-mid-high), -and \code{scale_*_stepsn} creates a n-colour binned gradient. These scales are +\verb{scale_*_steps} creates a two colour binned gradient (low-high), +\verb{scale_*_steps2} creates a diverging binned colour gradient (low-mid-high), +and \verb{scale_*_stepsn} creates a n-colour binned gradient. These scales are binned variants of the \link[=scale_colour_gradient]{gradient scale} family and works in the same way. } @@ -179,17 +222,17 @@ ggplot(df, aes(x, y)) + ggplot(df, aes(x, y)) + geom_point(aes(colour = z1)) + scale_colour_stepsn(colours = terrain.colors(10)) - } \seealso{ \code{\link[scales:seq_gradient_pal]{scales::seq_gradient_pal()}} for details on underlying palette -Other colour scales: \code{\link{scale_alpha}}, - \code{\link{scale_colour_brewer}}, - \code{\link{scale_colour_gradient}}, - \code{\link{scale_colour_grey}}, - \code{\link{scale_colour_hue}}, - \code{\link{scale_colour_viridis_d}} +Other colour scales: +\code{\link{scale_alpha}()}, +\code{\link{scale_colour_brewer}()}, +\code{\link{scale_colour_gradient}()}, +\code{\link{scale_colour_grey}()}, +\code{\link{scale_colour_hue}()}, +\code{\link{scale_colour_viridis_d}()} } \concept{colour scales} diff --git a/man/scale_viridis.Rd b/man/scale_viridis.Rd index d266cab34b..c6bc808c5e 100644 --- a/man/scale_viridis.Rd +++ b/man/scale_viridis.Rd @@ -14,27 +14,81 @@ \alias{scale_color_viridis_c} \title{Viridis colour scales from viridisLite} \usage{ -scale_colour_viridis_d(..., alpha = 1, begin = 0, end = 1, - direction = 1, option = "D", aesthetics = "colour") - -scale_fill_viridis_d(..., alpha = 1, begin = 0, end = 1, - direction = 1, option = "D", aesthetics = "fill") - -scale_colour_viridis_c(..., alpha = 1, begin = 0, end = 1, - direction = 1, option = "D", values = NULL, space = "Lab", - na.value = "grey50", guide = "colourbar", aesthetics = "colour") - -scale_fill_viridis_c(..., alpha = 1, begin = 0, end = 1, - direction = 1, option = "D", values = NULL, space = "Lab", - na.value = "grey50", guide = "colourbar", aesthetics = "fill") - -scale_colour_viridis_b(..., alpha = 1, begin = 0, end = 1, - direction = 1, option = "D", values = NULL, space = "Lab", - na.value = "grey50", guide = "coloursteps", aesthetics = "colour") - -scale_fill_viridis_b(..., alpha = 1, begin = 0, end = 1, - direction = 1, option = "D", values = NULL, space = "Lab", - na.value = "grey50", guide = "coloursteps", aesthetics = "fill") +scale_colour_viridis_d( + ..., + alpha = 1, + begin = 0, + end = 1, + direction = 1, + option = "D", + aesthetics = "colour" +) + +scale_fill_viridis_d( + ..., + alpha = 1, + begin = 0, + end = 1, + direction = 1, + option = "D", + aesthetics = "fill" +) + +scale_colour_viridis_c( + ..., + alpha = 1, + begin = 0, + end = 1, + direction = 1, + option = "D", + values = NULL, + space = "Lab", + na.value = "grey50", + guide = "colourbar", + aesthetics = "colour" +) + +scale_fill_viridis_c( + ..., + alpha = 1, + begin = 0, + end = 1, + direction = 1, + option = "D", + values = NULL, + space = "Lab", + na.value = "grey50", + guide = "colourbar", + aesthetics = "fill" +) + +scale_colour_viridis_b( + ..., + alpha = 1, + begin = 0, + end = 1, + direction = 1, + option = "D", + values = NULL, + space = "Lab", + na.value = "grey50", + guide = "coloursteps", + aesthetics = "colour" +) + +scale_fill_viridis_b( + ..., + alpha = 1, + begin = 0, + end = 1, + direction = 1, + option = "D", + values = NULL, + space = "Lab", + na.value = "grey50", + guide = "coloursteps", + aesthetics = "fill" +) } \arguments{ \item{...}{Other arguments passed on to \code{\link[=discrete_scale]{discrete_scale()}}, @@ -62,7 +116,7 @@ same time, via \code{aesthetics = c("colour", "fill")}.} \item{values}{if colours should not be evenly positioned along the gradient this vector gives the position (between 0 and 1) for each colour in the -\code{colours} vector. See \code{\link[=rescale]{rescale()}} for a convenience function +\code{colours} vector. See \code{\link[scales:rescale]{rescale()}} for a convenience function to map an arbitrary range to between 0 and 1.} \item{space}{colour space in which to calculate gradient. Must be "Lab" - @@ -93,7 +147,7 @@ txsamp <- subset(txhousing, city \%in\% d + scale_colour_viridis_d() # Change scale label -d + scale_colour_viridis_d("City\\nCenter") +d + scale_colour_viridis_d("City\nCenter") # Select palette to use, see ?scales::viridis_pal for more details d + scale_colour_viridis_d(option = "plasma") @@ -118,11 +172,12 @@ v + scale_fill_viridis_b() } \seealso{ -Other colour scales: \code{\link{scale_alpha}}, - \code{\link{scale_colour_brewer}}, - \code{\link{scale_colour_gradient}}, - \code{\link{scale_colour_grey}}, - \code{\link{scale_colour_hue}}, - \code{\link{scale_colour_steps}} +Other colour scales: +\code{\link{scale_alpha}()}, +\code{\link{scale_colour_brewer}()}, +\code{\link{scale_colour_gradient}()}, +\code{\link{scale_colour_grey}()}, +\code{\link{scale_colour_hue}()}, +\code{\link{scale_colour_steps}()} } \concept{colour scales} diff --git a/man/sec_axis.Rd b/man/sec_axis.Rd index b57d45aaa7..d0176b5d67 100644 --- a/man/sec_axis.Rd +++ b/man/sec_axis.Rd @@ -6,11 +6,21 @@ \alias{derive} \title{Specify a secondary axis} \usage{ -sec_axis(trans = NULL, name = waiver(), breaks = waiver(), - labels = waiver(), guide = waiver()) - -dup_axis(trans = ~., name = derive(), breaks = derive(), - labels = derive(), guide = derive()) +sec_axis( + trans = NULL, + name = waiver(), + breaks = waiver(), + labels = waiver(), + guide = waiver() +) + +dup_axis( + trans = ~., + name = derive(), + breaks = derive(), + labels = derive(), + guide = derive() +) derive() } diff --git a/man/stat_ecdf.Rd b/man/stat_ecdf.Rd index 6f96c6c2a9..5e07ccb3d4 100644 --- a/man/stat_ecdf.Rd +++ b/man/stat_ecdf.Rd @@ -4,9 +4,18 @@ \alias{stat_ecdf} \title{Compute empirical cumulative distribution} \usage{ -stat_ecdf(mapping = NULL, data = NULL, geom = "step", - position = "identity", ..., n = NULL, pad = TRUE, na.rm = FALSE, - show.legend = NA, inherit.aes = TRUE) +stat_ecdf( + mapping = NULL, + data = NULL, + geom = "step", + position = "identity", + ..., + n = NULL, + pad = TRUE, + na.rm = FALSE, + show.legend = NA, + inherit.aes = TRUE +) } \arguments{ \item{mapping}{Set of aesthetic mappings created by \code{\link[=aes]{aes()}} or diff --git a/man/stat_ellipse.Rd b/man/stat_ellipse.Rd index 0923ff478b..d8819ba768 100644 --- a/man/stat_ellipse.Rd +++ b/man/stat_ellipse.Rd @@ -4,10 +4,19 @@ \alias{stat_ellipse} \title{Compute normal data ellipses} \usage{ -stat_ellipse(mapping = NULL, data = NULL, geom = "path", - position = "identity", ..., type = "t", level = 0.95, - segments = 51, na.rm = FALSE, show.legend = NA, - inherit.aes = TRUE) +stat_ellipse( + mapping = NULL, + data = NULL, + geom = "path", + position = "identity", + ..., + type = "t", + level = 0.95, + segments = 51, + na.rm = FALSE, + show.legend = NA, + inherit.aes = TRUE +) } \arguments{ \item{mapping}{Set of aesthetic mappings created by \code{\link[=aes]{aes()}} or diff --git a/man/stat_function.Rd b/man/stat_function.Rd index 44c54d7c83..8b170be569 100644 --- a/man/stat_function.Rd +++ b/man/stat_function.Rd @@ -4,10 +4,20 @@ \alias{stat_function} \title{Compute function for each x value} \usage{ -stat_function(mapping = NULL, data = NULL, geom = "path", - position = "identity", ..., fun, xlim = NULL, n = 101, - args = list(), na.rm = FALSE, show.legend = NA, - inherit.aes = TRUE) +stat_function( + mapping = NULL, + data = NULL, + geom = "path", + position = "identity", + ..., + fun, + xlim = NULL, + n = 101, + args = list(), + na.rm = FALSE, + show.legend = NA, + inherit.aes = TRUE +) } \arguments{ \item{mapping}{Set of aesthetic mappings created by \code{\link[=aes]{aes()}} or diff --git a/man/stat_identity.Rd b/man/stat_identity.Rd index 3628b28a0a..884b9eae17 100644 --- a/man/stat_identity.Rd +++ b/man/stat_identity.Rd @@ -4,8 +4,15 @@ \alias{stat_identity} \title{Leave data as is} \usage{ -stat_identity(mapping = NULL, data = NULL, geom = "point", - position = "identity", ..., show.legend = NA, inherit.aes = TRUE) +stat_identity( + mapping = NULL, + data = NULL, + geom = "point", + position = "identity", + ..., + show.legend = NA, + inherit.aes = TRUE +) } \arguments{ \item{mapping}{Set of aesthetic mappings created by \code{\link[=aes]{aes()}} or diff --git a/man/stat_sf_coordinates.Rd b/man/stat_sf_coordinates.Rd index b47bf64e82..92309eba7b 100644 --- a/man/stat_sf_coordinates.Rd +++ b/man/stat_sf_coordinates.Rd @@ -6,9 +6,17 @@ \alias{StatSfCoordinates} \title{Extract coordinates from 'sf' objects} \usage{ -stat_sf_coordinates(mapping = aes(), data = NULL, geom = "point", - position = "identity", na.rm = FALSE, show.legend = NA, - inherit.aes = TRUE, fun.geometry = NULL, ...) +stat_sf_coordinates( + mapping = aes(), + data = NULL, + geom = "point", + position = "identity", + na.rm = FALSE, + show.legend = NA, + inherit.aes = TRUE, + fun.geometry = NULL, + ... +) } \arguments{ \item{mapping}{Set of aesthetic mappings created by \code{\link[=aes]{aes()}} or diff --git a/man/stat_summary.Rd b/man/stat_summary.Rd index 6480650e9d..2fd2642a65 100644 --- a/man/stat_summary.Rd +++ b/man/stat_summary.Rd @@ -5,17 +5,48 @@ \alias{stat_summary} \title{Summarise y values at unique/binned x} \usage{ -stat_summary_bin(mapping = NULL, data = NULL, geom = "pointrange", - position = "identity", ..., fun.data = NULL, fun = NULL, - fun.max = NULL, fun.min = NULL, fun.args = list(), bins = 30, - binwidth = NULL, breaks = NULL, na.rm = FALSE, orientation = NA, - show.legend = NA, inherit.aes = TRUE, fun.y, fun.ymin, fun.ymax) - -stat_summary(mapping = NULL, data = NULL, geom = "pointrange", - position = "identity", ..., fun.data = NULL, fun = NULL, - fun.max = NULL, fun.min = NULL, fun.args = list(), na.rm = FALSE, - orientation = NA, show.legend = NA, inherit.aes = TRUE, fun.y, - fun.ymin, fun.ymax) +stat_summary_bin( + mapping = NULL, + data = NULL, + geom = "pointrange", + position = "identity", + ..., + fun.data = NULL, + fun = NULL, + fun.max = NULL, + fun.min = NULL, + fun.args = list(), + bins = 30, + binwidth = NULL, + breaks = NULL, + na.rm = FALSE, + orientation = NA, + show.legend = NA, + inherit.aes = TRUE, + fun.y, + fun.ymin, + fun.ymax +) + +stat_summary( + mapping = NULL, + data = NULL, + geom = "pointrange", + position = "identity", + ..., + fun.data = NULL, + fun = NULL, + fun.max = NULL, + fun.min = NULL, + fun.args = list(), + na.rm = FALSE, + orientation = NA, + show.legend = NA, + inherit.aes = TRUE, + fun.y, + fun.ymin, + fun.ymax +) } \arguments{ \item{mapping}{Set of aesthetic mappings created by \code{\link[=aes]{aes()}} or diff --git a/man/stat_summary_2d.Rd b/man/stat_summary_2d.Rd index 51a90038c9..f51109717c 100644 --- a/man/stat_summary_2d.Rd +++ b/man/stat_summary_2d.Rd @@ -6,15 +6,37 @@ \alias{stat_summary_hex} \title{Bin and summarise in 2d (rectangle & hexagons)} \usage{ -stat_summary_2d(mapping = NULL, data = NULL, geom = "tile", - position = "identity", ..., bins = 30, binwidth = NULL, - drop = TRUE, fun = "mean", fun.args = list(), na.rm = FALSE, - show.legend = NA, inherit.aes = TRUE) - -stat_summary_hex(mapping = NULL, data = NULL, geom = "hex", - position = "identity", ..., bins = 30, binwidth = NULL, - drop = TRUE, fun = "mean", fun.args = list(), na.rm = FALSE, - show.legend = NA, inherit.aes = TRUE) +stat_summary_2d( + mapping = NULL, + data = NULL, + geom = "tile", + position = "identity", + ..., + bins = 30, + binwidth = NULL, + drop = TRUE, + fun = "mean", + fun.args = list(), + na.rm = FALSE, + show.legend = NA, + inherit.aes = TRUE +) + +stat_summary_hex( + mapping = NULL, + data = NULL, + geom = "hex", + position = "identity", + ..., + bins = 30, + binwidth = NULL, + drop = TRUE, + fun = "mean", + fun.args = list(), + na.rm = FALSE, + show.legend = NA, + inherit.aes = TRUE +) } \arguments{ \item{mapping}{Set of aesthetic mappings created by \code{\link[=aes]{aes()}} or diff --git a/man/stat_unique.Rd b/man/stat_unique.Rd index a646b4fd77..3701b68d1f 100644 --- a/man/stat_unique.Rd +++ b/man/stat_unique.Rd @@ -4,9 +4,16 @@ \alias{stat_unique} \title{Remove duplicates} \usage{ -stat_unique(mapping = NULL, data = NULL, geom = "point", - position = "identity", ..., na.rm = FALSE, show.legend = NA, - inherit.aes = TRUE) +stat_unique( + mapping = NULL, + data = NULL, + geom = "point", + position = "identity", + ..., + na.rm = FALSE, + show.legend = NA, + inherit.aes = TRUE +) } \arguments{ \item{mapping}{Set of aesthetic mappings created by \code{\link[=aes]{aes()}} or diff --git a/man/theme.Rd b/man/theme.Rd index 09962d32d5..e7ec488409 100644 --- a/man/theme.Rd +++ b/man/theme.Rd @@ -4,30 +4,104 @@ \alias{theme} \title{Modify components of a theme} \usage{ -theme(line, rect, text, title, aspect.ratio, axis.title, axis.title.x, - axis.title.x.top, axis.title.x.bottom, axis.title.y, axis.title.y.left, - axis.title.y.right, axis.text, axis.text.x, axis.text.x.top, - axis.text.x.bottom, axis.text.y, axis.text.y.left, axis.text.y.right, - axis.ticks, axis.ticks.x, axis.ticks.x.top, axis.ticks.x.bottom, - axis.ticks.y, axis.ticks.y.left, axis.ticks.y.right, axis.ticks.length, - axis.ticks.length.x, axis.ticks.length.x.top, axis.ticks.length.x.bottom, - axis.ticks.length.y, axis.ticks.length.y.left, axis.ticks.length.y.right, - axis.line, axis.line.x, axis.line.x.top, axis.line.x.bottom, axis.line.y, - axis.line.y.left, axis.line.y.right, legend.background, legend.margin, - legend.spacing, legend.spacing.x, legend.spacing.y, legend.key, - legend.key.size, legend.key.height, legend.key.width, legend.text, - legend.text.align, legend.title, legend.title.align, legend.position, - legend.direction, legend.justification, legend.box, legend.box.just, - legend.box.margin, legend.box.background, legend.box.spacing, - panel.background, panel.border, panel.spacing, panel.spacing.x, - panel.spacing.y, panel.grid, panel.grid.major, panel.grid.minor, - panel.grid.major.x, panel.grid.major.y, panel.grid.minor.x, - panel.grid.minor.y, panel.ontop, plot.background, plot.title, - plot.title.position, plot.subtitle, plot.caption, plot.caption.position, - plot.tag, plot.tag.position, plot.margin, strip.background, - strip.background.x, strip.background.y, strip.placement, strip.text, - strip.text.x, strip.text.y, strip.switch.pad.grid, strip.switch.pad.wrap, - ..., complete = FALSE, validate = TRUE, element_tree = NULL) +theme( + line, + rect, + text, + title, + aspect.ratio, + axis.title, + axis.title.x, + axis.title.x.top, + axis.title.x.bottom, + axis.title.y, + axis.title.y.left, + axis.title.y.right, + axis.text, + axis.text.x, + axis.text.x.top, + axis.text.x.bottom, + axis.text.y, + axis.text.y.left, + axis.text.y.right, + axis.ticks, + axis.ticks.x, + axis.ticks.x.top, + axis.ticks.x.bottom, + axis.ticks.y, + axis.ticks.y.left, + axis.ticks.y.right, + axis.ticks.length, + axis.ticks.length.x, + axis.ticks.length.x.top, + axis.ticks.length.x.bottom, + axis.ticks.length.y, + axis.ticks.length.y.left, + axis.ticks.length.y.right, + axis.line, + axis.line.x, + axis.line.x.top, + axis.line.x.bottom, + axis.line.y, + axis.line.y.left, + axis.line.y.right, + legend.background, + legend.margin, + legend.spacing, + legend.spacing.x, + legend.spacing.y, + legend.key, + legend.key.size, + legend.key.height, + legend.key.width, + legend.text, + legend.text.align, + legend.title, + legend.title.align, + legend.position, + legend.direction, + legend.justification, + legend.box, + legend.box.just, + legend.box.margin, + legend.box.background, + legend.box.spacing, + panel.background, + panel.border, + panel.spacing, + panel.spacing.x, + panel.spacing.y, + panel.grid, + panel.grid.major, + panel.grid.minor, + panel.grid.major.x, + panel.grid.major.y, + panel.grid.minor.x, + panel.grid.minor.y, + panel.ontop, + plot.background, + plot.title, + plot.title.position, + plot.subtitle, + plot.caption, + plot.caption.position, + plot.tag, + plot.tag.position, + plot.margin, + strip.background, + strip.background.x, + strip.background.y, + strip.placement, + strip.text, + strip.text.x, + strip.text.y, + strip.switch.pad.grid, + strip.switch.pad.wrap, + ..., + complete = FALSE, + validate = TRUE, + element_tree = NULL +) } \arguments{ \item{line}{all line elements (\code{\link[=element_line]{element_line()}})} @@ -44,22 +118,22 @@ inherits from \code{text})} \item{axis.title, axis.title.x, axis.title.y, axis.title.x.top, axis.title.x.bottom, axis.title.y.left, axis.title.y.right}{labels of axes (\code{\link[=element_text]{element_text()}}). Specify all axes' labels (\code{axis.title}), labels by plane (using \code{axis.title.x} or \code{axis.title.y}), or individually for each axis (using \code{axis.title.x.bottom}, \code{axis.title.x.top}, -\code{axis.title.y.left}, \code{axis.title.y.right}). \code{axis.title.*.*} inherits from -\code{axis.title.*} which inherits from \code{axis.title}, which in turn inherits +\code{axis.title.y.left}, \code{axis.title.y.right}). \verb{axis.title.*.*} inherits from +\verb{axis.title.*} which inherits from \code{axis.title}, which in turn inherits from \code{text}} \item{axis.text, axis.text.x, axis.text.y, axis.text.x.top, axis.text.x.bottom, axis.text.y.left, axis.text.y.right}{tick labels along axes (\code{\link[=element_text]{element_text()}}). Specify all axis tick labels (\code{axis.text}), tick labels by plane (using \code{axis.text.x} or \code{axis.text.y}), or individually for each axis (using \code{axis.text.x.bottom}, \code{axis.text.x.top}, -\code{axis.text.y.left}, \code{axis.text.y.right}). \code{axis.text.*.*} inherits from -\code{axis.text.*} which inherits from \code{axis.text}, which in turn inherits +\code{axis.text.y.left}, \code{axis.text.y.right}). \verb{axis.text.*.*} inherits from +\verb{axis.text.*} which inherits from \code{axis.text}, which in turn inherits from \code{text}} \item{axis.ticks, axis.ticks.x, axis.ticks.x.top, axis.ticks.x.bottom, axis.ticks.y, axis.ticks.y.left, axis.ticks.y.right}{tick marks along axes (\code{\link[=element_line]{element_line()}}). Specify all tick marks (\code{axis.ticks}), ticks by plane (using \code{axis.ticks.x} or \code{axis.ticks.y}), or individually for each axis (using \code{axis.ticks.x.bottom}, \code{axis.ticks.x.top}, -\code{axis.ticks.y.left}, \code{axis.ticks.y.right}). \code{axis.ticks.*.*} inherits from -\code{axis.ticks.*} which inherits from \code{axis.ticks}, which in turn inherits +\code{axis.ticks.y.left}, \code{axis.ticks.y.right}). \verb{axis.ticks.*.*} inherits from +\verb{axis.ticks.*} which inherits from \code{axis.ticks}, which in turn inherits from \code{line}} \item{axis.ticks.length, axis.ticks.length.x, axis.ticks.length.x.top, axis.ticks.length.x.bottom, axis.ticks.length.y, axis.ticks.length.y.left, axis.ticks.length.y.right}{length of tick marks (\code{unit})} @@ -67,8 +141,8 @@ from \code{line}} \item{axis.line, axis.line.x, axis.line.x.top, axis.line.x.bottom, axis.line.y, axis.line.y.left, axis.line.y.right}{lines along axes (\code{\link[=element_line]{element_line()}}). Specify lines along all axes (\code{axis.line}), lines for each plane (using \code{axis.line.x} or \code{axis.line.y}), or individually for each axis (using \code{axis.line.x.bottom}, \code{axis.line.x.top}, -\code{axis.line.y.left}, \code{axis.line.y.right}). \code{axis.line.*.*} inherits from -\code{axis.line.*} which inherits from \code{axis.line}, which in turn inherits +\code{axis.line.y.left}, \code{axis.line.y.right}). \verb{axis.line.*.*} inherits from +\verb{axis.line.*} which inherits from \code{axis.line}, which in turn inherits from \code{line}} \item{legend.background}{background of legend (\code{\link[=element_rect]{element_rect()}}; inherits @@ -139,8 +213,8 @@ or can be specified separately.} or minor grid lines separately (using \code{panel.grid.major} or \code{panel.grid.minor}) or individually for each axis (using \code{panel.grid.major.x}, \code{panel.grid.minor.x}, \code{panel.grid.major.y}, \code{panel.grid.minor.y}). Y axis grid lines are horizontal -and x axis grid lines are vertical. \code{panel.grid.*.*} inherits from -\code{panel.grid.*} which inherits from \code{panel.grid}, which in turn inherits +and x axis grid lines are vertical. \verb{panel.grid.*.*} inherits from +\verb{panel.grid.*} which inherits from \code{panel.grid}, which in turn inherits from \code{line}} \item{panel.ontop}{option to place the panel (background, gridlines) over @@ -330,7 +404,7 @@ p3 + theme(panel.spacing = unit(1, "lines")) } } \seealso{ -\code{\link[=+.gg]{+.gg()}} and \code{\link{\%+replace\%}}, +\code{\link[=+.gg]{+.gg()}} and \link{\%+replace\%}, \code{\link[=element_blank]{element_blank()}}, \code{\link[=element_line]{element_line()}}, \code{\link[=element_rect]{element_rect()}}, and \code{\link[=element_text]{element_text()}} for details of the specific theme elements. diff --git a/man/theme_get.Rd b/man/theme_get.Rd index a4928092de..9587ebe423 100644 --- a/man/theme_get.Rd +++ b/man/theme_get.Rd @@ -39,19 +39,19 @@ shorthands for changing individual elements. \section{Adding on to a theme}{ -\code{+} and \code{\%+replace\%} can be used to modify elements in themes. +\code{+} and \verb{\%+replace\%} can be used to modify elements in themes. \code{+} updates the elements of e1 that differ from elements specified (not NULL) in e2. Thus this operator can be used to incrementally add or modify attributes of a ggplot theme. -In contrast, \code{\%+replace\%} replaces the entire element; any element of +In contrast, \verb{\%+replace\%} replaces the entire element; any element of a theme not specified in e2 will not be present in the resulting theme (i.e. NULL). Thus this operator can be used to overwrite an entire theme. \code{theme_update} uses the \code{+} operator, so that any unspecified values in the theme element will default to the values they are set in the -theme. \code{theme_replace} uses \code{\%+replace\%} to completely replace +theme. \code{theme_replace} uses \verb{\%+replace\%} to completely replace the element, so any unspecified values will overwrite the current value in the theme with \code{NULL}s. } From b480de8059d4bd261efaa3dba9ce69db4abab0ac Mon Sep 17 00:00:00 2001 From: Katrin Leinweber <9948149+katrinleinweber@users.noreply.github.com> Date: Tue, 26 Nov 2019 08:06:09 +0100 Subject: [PATCH 3/4] Direct link to function docu, not package docu (#3641) --- R/aes.r | 2 +- man/aes.Rd | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/R/aes.r b/R/aes.r index ef6f9dd602..fd01bfd274 100644 --- a/R/aes.r +++ b/R/aes.r @@ -5,7 +5,7 @@ NULL #' #' Aesthetic mappings describe how variables in the data are mapped to visual #' properties (aesthetics) of geoms. Aesthetic mappings can be set in -#' [ggplot2()] and in individual layers. +#' [ggplot()] and in individual layers. #' #' This function also standardises aesthetic names by converting `color` to `colour` #' (also in substrings, e.g., `point_color` to `point_colour`) and translating old style diff --git a/man/aes.Rd b/man/aes.Rd index 5b1c80daab..3075d6a0c5 100644 --- a/man/aes.Rd +++ b/man/aes.Rd @@ -22,7 +22,7 @@ quosures or constants. \description{ Aesthetic mappings describe how variables in the data are mapped to visual properties (aesthetics) of geoms. Aesthetic mappings can be set in -\code{\link[=ggplot2]{ggplot2()}} and in individual layers. +\code{\link[=ggplot]{ggplot()}} and in individual layers. } \details{ This function also standardises aesthetic names by converting \code{color} to \code{colour} From 64248088462cc3114d0eb4e30beafd2550d19284 Mon Sep 17 00:00:00 2001 From: microly Date: Wed, 27 Nov 2019 13:20:53 +0800 Subject: [PATCH 4/4] Correct a spelling mistake in the documatation of continuous_scale (#3643) * correct a spelling mistake in the documatation of continuous_scale --- R/scale-.r | 2 +- man/binned_scale.Rd | 2 +- man/continuous_scale.Rd | 2 +- man/scale_gradient.Rd | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/R/scale-.r b/R/scale-.r index 8bd5fd7d2a..8effd494a4 100644 --- a/R/scale-.r +++ b/R/scale-.r @@ -49,7 +49,7 @@ #' range \[0, 1]. This is always [scales::rescale()], except for #' diverging and n colour gradients (i.e., [scale_colour_gradient2()], #' [scale_colour_gradientn()]). The `rescaler` is ignored by position -#' scales, which ways use [scales::rescale()]. +#' scales, which always use [scales::rescale()]. #' @param oob One of: #' - Function that handles limits outside of the scale limits #' (out of bounds). diff --git a/man/binned_scale.Rd b/man/binned_scale.Rd index 74c39af560..63e79795d9 100644 --- a/man/binned_scale.Rd +++ b/man/binned_scale.Rd @@ -77,7 +77,7 @@ If the purpose is to zoom, use the limit argument in the coordinate system range [0, 1]. This is always \code{\link[scales:rescale]{scales::rescale()}}, except for diverging and n colour gradients (i.e., \code{\link[=scale_colour_gradient2]{scale_colour_gradient2()}}, \code{\link[=scale_colour_gradientn]{scale_colour_gradientn()}}). The \code{rescaler} is ignored by position -scales, which ways use \code{\link[scales:rescale]{scales::rescale()}}.} +scales, which always use \code{\link[scales:rescale]{scales::rescale()}}.} \item{oob}{One of: \itemize{ diff --git a/man/continuous_scale.Rd b/man/continuous_scale.Rd index 2ea6a4843f..65948e4f42 100644 --- a/man/continuous_scale.Rd +++ b/man/continuous_scale.Rd @@ -89,7 +89,7 @@ If the purpose is to zoom, use the limit argument in the coordinate system range [0, 1]. This is always \code{\link[scales:rescale]{scales::rescale()}}, except for diverging and n colour gradients (i.e., \code{\link[=scale_colour_gradient2]{scale_colour_gradient2()}}, \code{\link[=scale_colour_gradientn]{scale_colour_gradientn()}}). The \code{rescaler} is ignored by position -scales, which ways use \code{\link[scales:rescale]{scales::rescale()}}.} +scales, which always use \code{\link[scales:rescale]{scales::rescale()}}.} \item{oob}{One of: \itemize{ diff --git a/man/scale_gradient.Rd b/man/scale_gradient.Rd index c565436b59..f70ec3bbc3 100644 --- a/man/scale_gradient.Rd +++ b/man/scale_gradient.Rd @@ -142,7 +142,7 @@ If the purpose is to zoom, use the limit argument in the coordinate system range [0, 1]. This is always \code{\link[scales:rescale]{scales::rescale()}}, except for diverging and n colour gradients (i.e., \code{\link[=scale_colour_gradient2]{scale_colour_gradient2()}}, \code{\link[=scale_colour_gradientn]{scale_colour_gradientn()}}). The \code{rescaler} is ignored by position -scales, which ways use \code{\link[scales:rescale]{scales::rescale()}}.} +scales, which always use \code{\link[scales:rescale]{scales::rescale()}}.} \item{\code{oob}}{One of: \itemize{ \item Function that handles limits outside of the scale limits