Skip to content

Add more parens #4061

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jun 20, 2020
Merged
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
2 changes: 1 addition & 1 deletion R/aes.r
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ is_position_aes <- function(vars) {
#'
#' Aesthetic mappings describe how variables in the data are mapped to visual
#' properties (aesthetics) of geoms. [aes()] uses non-standard
#' evaluation to capture the variable names. `aes_` and `aes_string`
#' evaluation to capture the variable names. `aes_()` and `aes_string()`
#' require you to explicitly quote the inputs either with `""` for
#' `aes_string()`, or with `quote` or `~` for `aes_()`.
#' (`aes_q()` is an alias to `aes_()`). This makes `aes_()` and
Expand Down
2 changes: 1 addition & 1 deletion R/annotation-custom.r
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ NULL
#' @param ymin,ymax y location (in data coordinates) giving vertical
#' location of raster
#' @export
#' @note `annotation_custom` expects the grob to fill the entire viewport
#' @note `annotation_custom()` expects the grob to fill the entire viewport
#' defined by xmin, xmax, ymin, ymax. Grobs with a different (absolute) size
#' will be center-justified in that region.
#' Inf values can be used to fill the full plot panel (see examples).
Expand Down
2 changes: 1 addition & 1 deletion R/annotation-logticks.r
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#' long tick marks. In base 10, these are the "1" (or "10") ticks.
#' @param scaled is the data already log-scaled? This should be `TRUE`
#' (default) when the data is already transformed with `log10()` or when
#' using `scale_y_log10`. It should be `FALSE` when using
#' using `scale_y_log10()`. It should be `FALSE` when using
#' `coord_trans(y = "log10")`.
#' @param colour Colour of the tick marks.
#' @param size Thickness of tick marks, in mm.
Expand Down
2 changes: 1 addition & 1 deletion R/coord-.r
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#' @section Coordinate systems:
#'
#' All `coord_*` functions (like `coord_trans`) return a `Coord*`
#' All `coord_*()` functions (like `coord_trans()`) return a `Coord*`
#' object (like `CoordTrans`).
#'
#' Each of the `Coord*` objects is a [ggproto()] object,
Expand Down
2 changes: 1 addition & 1 deletion R/coord-map.r
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#' `coord_map()` projects a portion of the earth, which is approximately
#' spherical, onto a flat 2D plane using any projection defined by the
#' `mapproj` package. Map projections do not, in general, preserve straight
#' lines, so this requires considerable computation. `coord_quickmap` is a
#' lines, so this requires considerable computation. `coord_quickmap()` is a
#' quick approximation that does preserve straight lines. It works best for
#' smaller areas closer to the equator.
#'
Expand Down
6 changes: 3 additions & 3 deletions R/facet-.r
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ NULL
#' turn and is expected to supply a `PANEL` column mapping each row to a
#' panel defined in the layout. Additionally this method can also add or
#' subtract data points as needed e.g. in the case of adding margins to
#' `facet_grid`.
#' `facet_grid()`.
#'
#' - `draw_panels`: This is where the panels are assembled into a
#' `gtable` object. The method receives, among others, a list of grobs
Expand Down Expand Up @@ -494,8 +494,8 @@ max_width <- function(grobs, value_only = FALSE) {
#' Find panels in a gtable
#'
#' These functions help detect the placement of panels in a gtable, if they are
#' named with "panel" in the beginning. `find_panel` returns the extend of
#' the panel area, while `panel_cols` and `panel_rows` returns the
#' named with "panel" in the beginning. `find_panel()` returns the extend of
#' the panel area, while `panel_cols()` and `panel_rows()` returns the
#' columns and rows that contains panels respectively.
#'
#' @param table A gtable
Expand Down
2 changes: 1 addition & 1 deletion R/facet-wrap.r
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@ FacetWrap <- ggproto("FacetWrap", Facet,
#'
#' Cleans up the input to be an integer greater than or equal to one, or
#' `NULL`. Intended to be used on the `nrow` and `ncol`
#' arguments of `facet_wrap`.
#' arguments of `facet_wrap()`.
#' @param n Hopefully an integer greater than or equal to one, or `NULL`,
#' though other inputs are handled.
#' @return An integer greater than or equal to one, or `NULL`.
Expand Down
2 changes: 1 addition & 1 deletion R/fortify.r
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#' Fortify a model with data.
#'
#' Rather than using this function, I now recommend using the \pkg{broom}
#' package, which implements a much wider range of methods. `fortify`
#' package, which implements a much wider range of methods. `fortify()`
#' may be deprecated in the future.
#'
#' @seealso [fortify.lm()]
Expand Down
2 changes: 1 addition & 1 deletion R/geom-.r
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ NULL

#' @section Geoms:
#'
#' All `geom_*` functions (like `geom_point`) return a layer that
#' All `geom_*()` functions (like `geom_point()`) return a layer that
#' contains a `Geom*` object (like `GeomPoint`). The `Geom*`
#' object is responsible for rendering the data in the plot.
#'
Expand Down
2 changes: 1 addition & 1 deletion R/geom-bin2d.r
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#' @inheritParams layer
#' @inheritParams geom_point
#' @param geom,stat Use to override the default connection between
#' `geom_bin2d` and `stat_bin2d`.
#' `geom_bin2d()` and `stat_bin2d()`.
#' @seealso [stat_binhex()] for hexagonal binning
#' @examples
#' d <- ggplot(diamonds, aes(x, y)) + xlim(4, 10) + ylim(4, 10)
Expand Down
2 changes: 1 addition & 1 deletion R/geom-boxplot.r
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
#' @inheritParams layer
#' @inheritParams geom_bar
#' @param geom,stat Use to override the default connection between
#' `geom_boxplot` and `stat_boxplot`.
#' `geom_boxplot()` and `stat_boxplot()`.
#' @param outlier.colour,outlier.color,outlier.fill,outlier.shape,outlier.size,outlier.stroke,outlier.alpha
#' Default aesthetics for outliers. Set to `NULL` to inherit from the
#' aesthetics used for the box.
Expand Down
2 changes: 1 addition & 1 deletion R/geom-count.r
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#'
#' @eval rd_aesthetics("geom", "point")
#' @param geom,stat Use to override the default connection between
#' `geom_count` and `stat_sum`.
#' `geom_count()` and `stat_sum()`.
#' @seealso For continuous `x` and `y`, use [geom_bin2d()].
#' @inheritParams layer
#' @inheritParams geom_point
Expand Down
2 changes: 1 addition & 1 deletion R/geom-density.r
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#' @inheritParams geom_bar
#' @inheritParams geom_ribbon
#' @param geom,stat Use to override the default connection between
#' `geom_density` and `stat_density`.
#' `geom_density()` and `stat_density()`.
#' @export
#' @examples
#' ggplot(diamonds, aes(carat)) +
Expand Down
2 changes: 1 addition & 1 deletion R/geom-density2d.r
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#' how contours are drawn; [geom_bin2d()] for another way of dealing with
#' overplotting.
#' @param geom,stat Use to override the default connection between
#' `geom_density_2d` and `stat_density_2d`.
#' `geom_density_2d()` and `stat_density_2d()`.
#' @inheritParams layer
#' @inheritParams geom_point
#' @inheritParams geom_path
Expand Down
4 changes: 2 additions & 2 deletions R/geom-hex.r
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
#'
#' @eval rd_aesthetics("geom", "hex")
#' @seealso [stat_bin2d()] for rectangular binning
#' @param geom,stat Override the default connection between `geom_hex` and
#' `stat_binhex.`
#' @param geom,stat Override the default connection between `geom_hex()` and
#' `stat_binhex()`.
#' @export
#' @inheritParams layer
#' @inheritParams geom_point
Expand Down
6 changes: 3 additions & 3 deletions R/geom-histogram.r
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#' one change at a time. You may need to look at a few options to uncover
#' the full story behind your data.
#'
#' In addition to `geom_histogram`, you can create a histogram plot by using
#' In addition to `geom_histogram()`, you can create a histogram plot by using
#' `scale_x_binned()` with [geom_bar()]. This method by default plots tick marks
#' in between each bar.
#'
Expand All @@ -43,8 +43,8 @@
#' ggplot(diamonds, aes(y = carat)) +
#' geom_histogram()
#'
#' # For histograms with tick marks between each bin, use `geom_bar` with
#' # `scale_x_binned`.
#' # For histograms with tick marks between each bin, use `geom_bar()` with
#' # `scale_x_binned()`.
#' ggplot(diamonds, aes(carat)) +
#' geom_bar() +
#' scale_x_binned()
Expand Down
2 changes: 1 addition & 1 deletion R/geom-path.r
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#' [geom_polygon()]: Filled paths (polygons);
#' [geom_segment()]: Line segments
#' @section Missing value handling:
#' `geom_path()`, `geom_line()`, and `geom_step` handle `NA` as follows:
#' `geom_path()`, `geom_line()`, and `geom_step()` handle `NA` as follows:
#'
#' * If an `NA` occurs in the middle of a line, it breaks the line. No warning
#' is shown, regardless of whether `na.rm` is `TRUE` or `FALSE`.
Expand Down
2 changes: 1 addition & 1 deletion R/geom-quantile.r
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#' @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
#' `geom_quantile` and `stat_quantile`.
#' `geom_quantile()` and `stat_quantile()`.
#' @examples
#' m <- ggplot(mpg, aes(displ, 1 / hwy)) + geom_point()
#' m + geom_quantile()
Expand Down
4 changes: 2 additions & 2 deletions R/geom-segment.r
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#' Line segments and curves
#'
#' `geom_segment()` draws a straight line between points (x, y) and
#' (xend, yend). `geom_curve` draws a curved line. See the underlying
#' (xend, yend). `geom_curve()` draws a curved line. See the underlying
#' drawing function [grid::curveGrob()] for the parameters that
#' control the curve.
#'
#' Both geoms draw a single segment/curve per case. See `geom_path` if you
#' Both geoms draw a single segment/curve per case. See `geom_path()` if you
#' need to connect points across multiple cases.
#'
#' @eval rd_aesthetics("geom", "segment")
Expand Down
2 changes: 1 addition & 1 deletion R/geom-tile.r
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#' parameterised differently: `geom_rect()` uses the locations of the four
#' corners (`xmin`, `xmax`, `ymin` and `ymax`), while
#' `geom_tile()` uses the center of the tile and its size (`x`,
#' `y`, `width`, `height`). `geom_raster` is a high
#' `y`, `width`, `height`). `geom_raster()` is a high
#' performance special case for when all the tiles are the same size.
#'
#' @eval rd_aesthetics("geom", "tile")
Expand Down
2 changes: 1 addition & 1 deletion R/geom-violin.r
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#' @param trim If `TRUE` (default), trim the tails of the violins
#' to the range of the data. If `FALSE`, don't trim the tails.
#' @param geom,stat Use to override the default connection between
#' `geom_violin` and `stat_ydensity`.
#' `geom_violin()` and `stat_ydensity()`.
#' @export
#' @references Hintze, J. L., Nelson, R. D. (1998) Violin Plots: A Box
#' Plot-Density Trace Synergism. The American Statistician 52, 181-184.
Expand Down
4 changes: 2 additions & 2 deletions R/ggproto.r
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#' Create a new ggproto object
#'
#' Construct a new object with `ggproto`, test with `is.proto`,
#' and access parent methods/fields with `ggproto_parent`.
#' Construct a new object with `ggproto()`, test with `is.ggproto()`,
#' and access parent methods/fields with `ggproto_parent()`.
#'
#' ggproto implements a protype based OO system which blurs the lines between
#' classes and instances. It is inspired by the proto package, but it has some
Expand Down
2 changes: 1 addition & 1 deletion R/plot.r
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#'
#' `ggplot()` is used to construct the initial plot object,
#' and is almost always followed by `+` to add component to the
#' plot. There are three common ways to invoke `ggplot`:
#' plot. There are three common ways to invoke `ggplot()`:
#'
#' * `ggplot(df, aes(x, y, other aesthetics))`
#' * `ggplot(df)`
Expand Down
2 changes: 1 addition & 1 deletion R/position-.r
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#' @section Positions:
#'
#' All `position_*` functions (like `position_dodge`) return a
#' All `position_*()` functions (like `position_dodge()`) return a
#' `Position*` object (like `PositionDodge`). The `Position*`
#' object is responsible for adjusting the position of overlapping geoms.
#'
Expand Down
2 changes: 1 addition & 1 deletion R/quick-plot.r
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#' @param facets faceting formula to use. Picks [facet_wrap()] or
#' [facet_grid()] depending on whether the formula is one-
#' or two-sided
#' @param margins See `facet_grid`: display marginal facets?
#' @param margins See `facet_grid()`: display marginal facets?
#' @param geom Character vector specifying geom(s) to draw. Defaults to
#' "point" if x and y are specified, and "histogram" if only x is specified.
#' @param stat,position DEPRECATED.
Expand Down
2 changes: 1 addition & 1 deletion R/save.r
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
#' If not supplied, uses the size of current graphics device.
#' @param dpi Plot resolution. Also accepts a string input: "retina" (320),
#' "print" (300), or "screen" (72). Applies only to raster output types.
#' @param limitsize When `TRUE` (the default), `ggsave` will not
#' @param limitsize When `TRUE` (the default), `ggsave()` will not
#' save images larger than 50x50 inches, to prevent the common error of
#' specifying dimensions in pixels.
#' @param ... Other arguments passed on to the graphics device function,
Expand Down
2 changes: 1 addition & 1 deletion R/scale-type.R
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ find_global <- function(name, env, mode = "any") {
#'
#' @param x A vector
#' @return A character vector of scale types. These will be tried in turn
#' to find a default scale. For example, if `scale_type` returns
#' to find a default scale. For example, if `scale_type()` returns
#' `c("foo", "bar")` and the vector is used with the colour aesthetic,
#' ggplot2 will first look for `scale_colour_foo` then
#' `scale_colour_bar`.
Expand Down
2 changes: 1 addition & 1 deletion R/stat-.r
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#' @section Stats:
#'
#' All `stat_*` functions (like `stat_bin`) return a layer that
#' All `stat_*()` functions (like `stat_bin()`) return a layer that
#' contains a `Stat*` object (like `StatBin`). The `Stat*`
#' object is responsible for rendering the data in the plot.
#'
Expand Down
4 changes: 2 additions & 2 deletions R/stat-count.r
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
#' \item{prop}{groupwise proportion}
#' }
#' @seealso [stat_bin()], which bins data in ranges and counts the
#' cases in each range. It differs from `stat_count`, which counts the
#' cases in each range. It differs from `stat_count()`, which counts the
#' number of cases at each `x` position (without binning into ranges).
#' [stat_bin()] requires continuous `x` data, whereas
#' `stat_count` can be used for both discrete and continuous `x` data.
#' `stat_count()` can be used for both discrete and continuous `x` data.
#'
#' @export
#' @rdname geom_bar
Expand Down
4 changes: 2 additions & 2 deletions R/stat-qq.r
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@
#' @inheritParams layer
#' @inheritParams geom_point
#' @section Computed variables:
#' Variables computed by `stat_qq`:
#' Variables computed by `stat_qq()`:
#' \describe{
#' \item{sample}{sample quantiles}
#' \item{theoretical}{theoretical quantiles}
#' }
#' Variables computed by `stat_qq_line`:
#' Variables computed by `stat_qq_line()`:
#' \describe{
#' \item{x}{x-coordinates of the endpoints of the line segment connecting the
#' points at the chosen quantiles of the theoretical and the sample
Expand Down
10 changes: 5 additions & 5 deletions R/theme-current.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ NULL
#' Get, set, and modify the active theme
#'
#' The current/active theme (see [theme()]) is automatically applied to every
#' plot you draw. Use `theme_get` to get the current theme, and `theme_set` to
#' completely override it. `theme_update` and `theme_replace` are shorthands for
#' plot you draw. Use `theme_get()` to get the current theme, and `theme_set()` to
#' completely override it. `theme_update()` and `theme_replace()` are shorthands for
#' changing individual elements.
#'
#' @section Adding on to a theme:
Expand All @@ -21,9 +21,9 @@ NULL
#' 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_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 `%+replace%` to completely replace the element, so any
#' `theme_replace()` uses `%+replace%` to completely replace the element, so any
#' unspecified values will overwrite the current value in the theme with
#' `NULL`.
#'
Expand All @@ -37,7 +37,7 @@ NULL
#'
#' @param ... named list of theme settings
#' @param e1,e2 Theme and element to combine
#' @return `theme_set`, `theme_update`, and `theme_replace`
#' @return `theme_set()`, `theme_update()`, and `theme_replace()`
#' invisibly return the previous theme so you can easily save it, then
#' later restore it.
#' @seealso [+.gg()]
Expand Down
24 changes: 12 additions & 12 deletions R/theme-defaults.r
Original file line number Diff line number Diff line change
Expand Up @@ -12,37 +12,37 @@
#' @details
#' \describe{
#'
#' \item{`theme_gray`}{
#' \item{`theme_gray()`}{
#' The signature ggplot2 theme with a grey background and white gridlines,
#' designed to put the data forward yet make comparisons easy.}
#'
#' \item{`theme_bw`}{
#' \item{`theme_bw()`}{
#' The classic dark-on-light ggplot2 theme. May work better for presentations
#' displayed with a projector.}
#'
#' \item{`theme_linedraw`}{
#' \item{`theme_linedraw()`}{
#' A theme with only black lines of various widths on white backgrounds,
#' reminiscent of a line drawing. Serves a purpose similar to `theme_bw`.
#' reminiscent of a line drawing. Serves a purpose similar to `theme_bw()`.
#' Note that this theme has some very thin lines (<< 1 pt) which some journals
#' may refuse.}
#'
#' \item{`theme_light`}{
#' A theme similar to `theme_linedraw` but with light grey lines and axes,
#' \item{`theme_light()`}{
#' A theme similar to `theme_linedraw()` but with light grey lines and axes,
#' to direct more attention towards the data.}
#'
#' \item{`theme_dark`}{
#' The dark cousin of `theme_light`, with similar line sizes but a dark background. Useful to make thin coloured lines pop out.}
#' \item{`theme_dark()`}{
#' The dark cousin of `theme_light()`, with similar line sizes but a dark background. Useful to make thin coloured lines pop out.}
#'
#' \item{`theme_minimal`}{
#' \item{`theme_minimal()`}{
#' A minimalistic theme with no background annotations.}
#'
#' \item{`theme_classic`}{
#' \item{`theme_classic()`}{
#' A classic-looking theme, with x and y axis lines and no gridlines.}
#'
#' \item{`theme_void`}{
#' \item{`theme_void()`}{
#' A completely empty theme.}
#'
#' \item{`theme_test`}{
#' \item{`theme_test()`}{
#' A theme for visual unit tests. It should ideally never change except
#' for new features.}
#'
Expand Down
Loading