Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions R/annotation.R
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@
#' @param geom name of geom to use for annotation
#' @param x,y,xmin,ymin,xmax,ymax,xend,yend positioning aesthetics -
#' you must specify at least one of these.
#' @inheritParams layer
#' @inheritParams geom_point
#' @inheritParams shared_layer_parameters
#' @seealso
#' The `r link_book("custom annotations section", "annotations#sec-custom-annotations")`
#' @export
Expand Down
3 changes: 1 addition & 2 deletions R/geom-abline.R
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@ NULL
#'
#' @seealso See [geom_segment()] for a more general approach to
#' adding straight line segments to a plot.
#' @inheritParams layer
#' @inheritParams geom_point
#' @inheritParams shared_layer_parameters
#' @param mapping Set of aesthetic mappings created by [aes()].
#' @param xintercept,yintercept,slope,intercept Parameters that control the
#' position of the line. If these are set, `data`, `mapping` and
Expand Down
11 changes: 2 additions & 9 deletions R/geom-bar.R
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ GeomBar <- ggproto(
#' [position_fill()] shows relative proportions at each `x` by stacking the
#' bars and then standardising each bar to have the same height.
#'
#' @eval rd_orientation()
#' @inheritSection shared_layer_parameters Orientation
#'
#' @aesthetics GeomBar
#' @aesthetics GeomCol
Expand All @@ -76,12 +76,7 @@ GeomBar <- ggproto(
#' [position_dodge()] and [position_dodge2()] for creating side-by-side
#' bar charts.
#' @export
#' @inheritParams layer
#' @inheritParams geom_point
#' @param orientation The orientation of the layer. The default (`NA`)
#' 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.
#' @inheritParams shared_layer_parameters
#' @param just Adjustment for column placement. Set to `0.5` by default, meaning
#' that columns will be centered about axis breaks. Set to `0` or `1` to place
#' columns to the left/right of axis breaks. Note that this argument may have
Expand All @@ -90,8 +85,6 @@ GeomBar <- ggproto(
#' @param geom,stat Override the default connection between `geom_bar()` and
#' `stat_count()`. For more information about overriding these connections,
#' see how the [stat][layer_stats] and [geom][layer_geoms] arguments work.
#' @param lineend Line end style (round, butt, square).
#' @param linejoin Line join style (round, mitre, bevel).
#' @examples
#' # geom_bar is designed to make it easy to create bar charts that show
#' # counts (or sums of weights)
Expand Down
5 changes: 1 addition & 4 deletions R/geom-bin2d.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,11 @@ GeomBin2d <- ggproto("GeomBin2d", GeomTile)
#' @aesthetics GeomBin2d
#'
#' @export
#' @inheritParams layer
#' @inheritParams geom_point
#' @inheritParams shared_layer_parameters
#' @param geom,stat Use to override the default connection between
#' `geom_bin_2d()` and `stat_bin_2d()`. For more information about overriding
#' these connections, see how the [stat][layer_stats] and [geom][layer_geoms]
#' arguments work.
#' @param lineend Line end style (round, butt, square).
#' @param linejoin Line join style (round, mitre, bevel).
#' @seealso [stat_bin_hex()] for hexagonal binning
#' @examples
#' d <- ggplot(diamonds, aes(x, y)) + xlim(4, 10) + ylim(4, 10)
Expand Down
3 changes: 1 addition & 2 deletions R/geom-blank.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@
#' more details.
#'
#' @export
#' @inheritParams layer
#' @inheritParams geom_point
#' @inheritParams shared_layer_parameters
#' @examples
#' ggplot(mtcars, aes(wt, mpg))
#' # Nothing to see here!
Expand Down
5 changes: 2 additions & 3 deletions R/geom-boxplot.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#' It visualises five summary statistics (the median, two hinges
#' and two whiskers), and all "outlying" points individually.
#'
#' @eval rd_orientation()
#' @inheritSection shared_layer_parameters Orientation
#'
#' @section Summary statistics:
#' The lower and upper hinges correspond to the first and third quartiles
Expand All @@ -29,8 +29,7 @@
#' @seealso [geom_quantile()] for continuous `x`,
#' [geom_violin()] for a richer display of the distribution, and
#' [geom_jitter()] for a useful technique for small data.
#' @inheritParams layer
#' @inheritParams geom_bar
#' @inheritParams shared_layer_parameters
#' @param geom,stat Use to override the default connection between
#' `geom_boxplot()` and `stat_boxplot()`. For more information about
#' overriding these connections, see how the [stat][layer_stats] and
Expand Down
4 changes: 1 addition & 3 deletions R/geom-contour.R
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,7 @@ GeomContourFilled <- ggproto("GeomContourFilled", GeomPolygon)
#'
#' @aesthetics GeomContour
#' @aesthetics GeomContourFilled
#' @inheritParams layer
#' @inheritParams geom_point
#' @inheritParams geom_path
#' @inheritParams shared_layer_parameters
#' @param binwidth The width of the contour bins. Overridden by `bins`.
#' @param bins Number of contour bins. Overridden by `breaks`.
#' @param breaks One of:
Expand Down
3 changes: 1 addition & 2 deletions R/geom-count.R
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ NULL
#' these connections, see how the [stat][layer_stats] and [geom][layer_geoms]
#' arguments work.
#' @seealso For continuous `x` and `y`, use [geom_bin_2d()].
#' @inheritParams layer
#' @inheritParams geom_point
#' @inheritParams shared_layer_parameters
#' @export
#' @examples
#' ggplot(mpg, aes(cty, hwy)) +
Expand Down
5 changes: 2 additions & 3 deletions R/geom-density.R
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,12 @@ GeomDensity <- ggproto(
#' the histogram. This is a useful alternative to the histogram for continuous
#' data that comes from an underlying smooth distribution.
#'
#' @eval rd_orientation()
#' @inheritSection shared_layer_parameters Orientation
#' @aesthetics GeomDensity
#' @seealso See [geom_histogram()], [geom_freqpoly()] for
#' other methods of displaying continuous distribution.
#' See [geom_violin()] for a compact density display.
#' @inheritParams layer
#' @inheritParams geom_bar
#' @inheritParams shared_layer_parameters
#' @inheritParams geom_ribbon
#' @param geom,stat Use to override the default connection between
#' `geom_density()` and `stat_density()`. For more information about
Expand Down
4 changes: 1 addition & 3 deletions R/geom-density2d.R
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@
#' `geom_density_2d()` and `stat_density_2d()`. For more information at
#' overriding these connections, see how the [stat][layer_stats] and
#' [geom][layer_geoms] arguments work.
#' @inheritParams layer
#' @inheritParams geom_point
#' @inheritParams geom_path
#' @inheritParams shared_layer_parameters
#' @param contour_var Character string identifying the variable to contour
#' by. Can be one of `"density"`, `"ndensity"`, or `"count"`. See the section
#' on computed variables for details.
Expand Down
3 changes: 1 addition & 2 deletions R/geom-dotplot.R
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@
#' ndensity = 'density, scaled to maximum of 1, if method is `"histodot"`.'
#' )
#'
#' @inheritParams layer
#' @inheritParams geom_point
#' @inheritParams shared_layer_parameters
#' @param stackdir which direction to stack the dots. "up" (default),
#' "down", "center", "centerwhole" (centered, but with dots aligned)
#' @param stackratio how close to stack the dots. Default is 1, where dots
Expand Down
3 changes: 1 addition & 2 deletions R/geom-function.R
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@ GeomFunction <- ggproto("GeomFunction", GeomPath,
#'
#' @aesthetics GeomFunction
#' @param data Ignored by `stat_function()`, do not use.
#' @inheritParams layer
#' @inheritParams geom_path
#' @inheritParams shared_layer_parameters
#' @examples
#'
#' # geom_function() is useful for overlaying functions
Expand Down
6 changes: 1 addition & 5 deletions R/geom-hex.R
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,7 @@ GeomHex <- ggproto("GeomHex", Geom,
#' `stat_bin_hex()`. For more information about overriding these connections,
#' see how the [stat][layer_stats] and [geom][layer_geoms] arguments work.
#' @export
#' @inheritParams layer
#' @inheritParams geom_point
#' @param lineend Line end style (round, butt, square).
#' @param linejoin Line join style (round, mitre, bevel).
#' @param linemitre Line mitre limit (number greater than 1).
#' @inheritParams shared_layer_parameters
#' @export
#' @examples
#' d <- ggplot(diamonds, aes(carat, price))
Expand Down
5 changes: 2 additions & 3 deletions R/geom-histogram.R
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,14 @@
#' `scale_x_binned()` with [geom_bar()]. This method by default plots tick marks
#' in between each bar.
#'
#' @eval rd_orientation()
#' @inheritSection shared_layer_parameters Orientation
#'
#' @section Aesthetics:
#' `geom_histogram()` uses the same aesthetics as [geom_bar()];
#' `geom_freqpoly()` uses the same aesthetics as [geom_line()].
#'
#' @export
#' @inheritParams layer
#' @inheritParams geom_bar
#' @inheritParams shared_layer_parameters
#' @param geom,stat Use to override the default connection between
#' `geom_histogram()`/`geom_freqpoly()` and `stat_bin()`. For more information
#' at overriding these connections, see how the [stat][layer_stats] and
Expand Down
3 changes: 1 addition & 2 deletions R/geom-jitter.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@
#' overplotting caused by discreteness in smaller datasets.
#'
#' @aesthetics GeomPoint
#' @inheritParams layer
#' @inheritParams geom_point
#' @inheritParams shared_layer_parameters
#' @inheritParams position_jitter
#' @seealso
#' [geom_point()] for regular, unjittered points,
Expand Down
5 changes: 2 additions & 3 deletions R/geom-linerange.R
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ GeomLinerange <- ggproto(
#' Various ways of representing a vertical interval defined by `x`,
#' `ymin` and `ymax`. Each case draws a single graphical object.
#'
#' @eval rd_orientation()
#' @inheritSection shared_layer_parameters Orientation
#'
#' @aesthetics GeomLinerange
#' Note that `geom_pointrange()` also understands `size` for the size of the points.
Expand All @@ -53,8 +53,7 @@ GeomLinerange <- ggproto(
#' [stat_summary()] for examples of these guys in use,
#' [geom_smooth()] for continuous analogue
#' @export
#' @inheritParams layer
#' @inheritParams geom_bar
#' @inheritParams shared_layer_parameters
#' @examples
#' # Create a simple example dataset
#' df <- data.frame(
Expand Down
3 changes: 1 addition & 2 deletions R/geom-map.R
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ NULL
#' typically be created using [fortify()] on a spatial object.
#' It must contain columns `x` or `long`, `y` or
#' `lat`, and `region` or `id`.
#' @inheritParams layer
#' @inheritParams geom_point
#' @inheritParams shared_layer_parameters
#' @examples
#' # First, a made-up example containing a few polygons, to explain
#' # how `geom_map()` works. It requires two data frames:
Expand Down
11 changes: 2 additions & 9 deletions R/geom-path.R
Original file line number Diff line number Diff line change
Expand Up @@ -178,17 +178,10 @@ GeomStep <- ggproto(
#' An alternative parameterisation is [geom_segment()], where each line
#' corresponds to a single case which provides the start and end coordinates.
#'
#' @eval rd_orientation()
#' @inheritSection shared_layer_parameters Orientation
#'
#' @aesthetics GeomPath
#' @inheritParams layer
#' @inheritParams geom_bar
#' @param lineend Line end style (round, butt, square).
#' @param linejoin Line join style (round, mitre, bevel).
#' @param linemitre Line mitre limit (number greater than 1).
#' @param arrow Arrow specification, as created by [grid::arrow()].
#' @param arrow.fill fill colour to use for the arrow head (if closed). `NULL`
#' means use `colour` aesthetic.
#' @inheritParams shared_layer_parameters
#' @seealso
#' [geom_polygon()]: Filled paths (polygons);
#' [geom_segment()]: Line segments
Expand Down
29 changes: 1 addition & 28 deletions R/geom-point.R
Original file line number Diff line number Diff line change
Expand Up @@ -67,34 +67,7 @@ GeomPoint <- ggproto(
#'
#' @aesthetics GeomPoint
#' The `fill` aesthetic only applies to shapes 21-25.
#' @inheritParams layer
#' @param na.rm If `FALSE`, the default, missing values are removed with
#' a warning. If `TRUE`, missing values are silently removed.
#' @param ... Other arguments passed on to [layer()]'s `params` argument. These
#' arguments broadly fall into one of 4 categories below. Notably, further
#' arguments to the `position` argument, or aesthetics that are required
#' can *not* be passed through `...`. Unknown arguments that are not part
#' of the 4 categories below are ignored.
#' * Static aesthetics that are not mapped to a scale, but are at a fixed
#' value and apply to the layer as a whole. For example, `colour = "red"`
#' or `linewidth = 3`. The geom's documentation has an **Aesthetics**
#' section that lists the available options. The 'required' aesthetics
#' cannot be passed on to the `params`. Please note that while passing
#' unmapped aesthetics as vectors is technically possible, the order and
#' required length is not guaranteed to be parallel to the input data.
#' * When constructing a layer using
#' a `stat_*()` function, the `...` argument can be used to pass on
#' parameters to the `geom` part of the layer. An example of this is
#' `stat_density(geom = "area", outline.type = "both")`. The geom's
#' documentation lists which parameters it can accept.
#' * Inversely, when constructing a layer using a
#' `geom_*()` function, the `...` argument can be used to pass on parameters
#' to the `stat` part of the layer. An example of this is
#' `geom_area(stat = "density", adjust = 0.5)`. The stat's documentation
#' lists which parameters it can accept.
#' * The `key_glyph` argument of [`layer()`] may also be passed on through
#' `...`. This can be one of the functions described as
#' [key glyphs][draw_key], to change the display of the layer in the legend.
#' @inheritParams shared_layer_parameters
#'
#' @export
#' @examples
Expand Down
6 changes: 1 addition & 5 deletions R/geom-polygon.R
Original file line number Diff line number Diff line change
Expand Up @@ -105,11 +105,7 @@ GeomPolygon <- ggproto("GeomPolygon", Geom,
#' [geom_path()] for an unfilled polygon,
#' [geom_ribbon()] for a polygon anchored on the x-axis
#' @export
#' @inheritParams layer
#' @inheritParams geom_point
#' @param lineend Line end style (round, butt, square).
#' @param linejoin Line join style (round, mitre, bevel).
#' @param linemitre Line mitre limit (number greater than 1).
#' @inheritParams shared_layer_parameters
#' @param rule Either `"evenodd"` or `"winding"`. If polygons with holes are
#' being drawn (using the `subgroup` aesthetic) this argument defines how the
#' hole coordinates are interpreted. See the examples in [grid::pathGrob()] for
Expand Down
4 changes: 1 addition & 3 deletions R/geom-quantile.R
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@ GeomQuantile <- ggproto(
#'
#' @aesthetics GeomQuantile
#' @export
#' @inheritParams layer
#' @inheritParams geom_point
#' @inheritParams geom_path
#' @inheritParams shared_layer_parameters
#' @param method.args List of additional arguments passed on to the modelling
#' function defined by `method`.
#' @param geom,stat Use to override the default connection between
Expand Down
6 changes: 2 additions & 4 deletions R/geom-ribbon.R
Original file line number Diff line number Diff line change
Expand Up @@ -241,16 +241,14 @@ GeomArea <- ggproto("GeomArea", GeomRibbon,
#' of x-coordinates. To turn off this interpolation, `stat = "identity"` can
#' be used instead.
#'
#' @eval rd_orientation()
#' @inheritSection shared_layer_parameters Orientation
#'
#' @aesthetics GeomRibbon
#' @seealso
#' [geom_bar()] for discrete intervals (bars),
#' [geom_linerange()] for discrete intervals (lines),
#' [geom_polygon()] for general polygons
#' @inheritParams layer
#' @inheritParams geom_bar
#' @param linemitre Line mitre limit (number greater than 1).
#' @inheritParams shared_layer_parameters
#' @param outline.type Type of the outline of the area; `"both"` draws both the
#' upper and lower lines, `"upper"`/`"lower"` draws the respective lines only.
#' `"full"` draws a closed polygon around the area.
Expand Down
4 changes: 1 addition & 3 deletions R/geom-rug.R
Original file line number Diff line number Diff line change
Expand Up @@ -133,14 +133,12 @@ GeomRug <- ggproto("GeomRug", Geom,
#' any data points under the default settings.
#'
#' @aesthetics GeomRug
#' @inheritParams layer
#' @inheritParams geom_point
#' @inheritParams shared_layer_parameters
#' @param sides A string that controls which sides of the plot the rugs appear on.
#' It can be set to a string containing any of `"trbl"`, for top, right,
#' bottom, and left.
#' @param outside logical that controls whether to move the rug tassels outside of the plot area. Default is off (FALSE). You will also need to use `coord_cartesian(clip = "off")`. When set to TRUE, also consider changing the sides argument to "tr". See examples.
#' @param length A [grid::unit()] object that sets the length of the rug lines. Use scale expansion to avoid overplotting of data.
#' @param lineend Line end style (round, butt, square).
#' @export
#' @examples
#' p <- ggplot(mtcars, aes(wt, mpg)) +
Expand Down
8 changes: 1 addition & 7 deletions R/geom-segment.R
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,7 @@ GeomSegment <- ggproto(
#' need to connect points across multiple cases.
#'
#' @aesthetics GeomSegment
#' @inheritParams layer
#' @inheritParams geom_point
#' @param arrow specification for arrow heads, as created by [grid::arrow()].
#' @param arrow.fill fill colour to use for the arrow head (if closed). `NULL`
#' means use `colour` aesthetic.
#' @param lineend Line end style (round, butt, square).
#' @param linejoin Line join style (round, mitre, bevel).
#' @inheritParams shared_layer_parameters
#' @seealso [geom_path()] and [geom_line()] for multi-
#' segment lines and paths.
#' @seealso [geom_spoke()] for a segment parameterised by a location
Expand Down
2 changes: 1 addition & 1 deletion R/geom-sf.R
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ GeomSf <- ggproto("GeomSf", Geom,

#' @export
#' @rdname ggsf
#' @inheritParams geom_point
#' @inheritParams shared_layer_parameters
geom_sf <- function(mapping = aes(), data = NULL, stat = "sf",
position = "identity", na.rm = FALSE, show.legend = NA,
inherit.aes = TRUE, ...) {
Expand Down
5 changes: 2 additions & 3 deletions R/geom-smooth.R
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,10 @@ GeomSmooth <- ggproto(
#' `glm()`, where the normal confidence band is constructed on the link
#' scale and then back-transformed to the response scale.
#'
#' @eval rd_orientation()
#' @inheritSection shared_layer_parameters Orientation
#'
#' @aesthetics GeomSmooth
#' @inheritParams layer
#' @inheritParams geom_bar
#' @inheritParams shared_layer_parameters
#' @param geom,stat Use to override the default connection between
#' `geom_smooth()` and `stat_smooth()`. For more information about overriding
#' these connections, see how the [stat][layer_stats] and [geom][layer_geoms]
Expand Down
3 changes: 1 addition & 2 deletions R/geom-spoke.R
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@ GeomSpoke <- ggproto(
#' The angles start from east and increase counterclockwise.
#'
#' @aesthetics GeomSpoke
#' @inheritParams layer
#' @inheritParams geom_segment
#' @inheritParams shared_layer_parameters
#' @export
#' @examples
#' df <- expand.grid(x = 1:10, y=1:10)
Expand Down
Loading