Skip to content

Commit b36bba8

Browse files
authored
Add more parens (#4061)
* Add more parens * Document * Un-paren
1 parent 2edcec1 commit b36bba8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+122
-122
lines changed

R/aes.r

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ is_position_aes <- function(vars) {
214214
#'
215215
#' Aesthetic mappings describe how variables in the data are mapped to visual
216216
#' properties (aesthetics) of geoms. [aes()] uses non-standard
217-
#' evaluation to capture the variable names. `aes_` and `aes_string`
217+
#' evaluation to capture the variable names. `aes_()` and `aes_string()`
218218
#' require you to explicitly quote the inputs either with `""` for
219219
#' `aes_string()`, or with `quote` or `~` for `aes_()`.
220220
#' (`aes_q()` is an alias to `aes_()`). This makes `aes_()` and

R/annotation-custom.r

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ NULL
1717
#' @param ymin,ymax y location (in data coordinates) giving vertical
1818
#' location of raster
1919
#' @export
20-
#' @note `annotation_custom` expects the grob to fill the entire viewport
20+
#' @note `annotation_custom()` expects the grob to fill the entire viewport
2121
#' defined by xmin, xmax, ymin, ymax. Grobs with a different (absolute) size
2222
#' will be center-justified in that region.
2323
#' Inf values can be used to fill the full plot panel (see examples).

R/annotation-logticks.r

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
#' long tick marks. In base 10, these are the "1" (or "10") ticks.
1919
#' @param scaled is the data already log-scaled? This should be `TRUE`
2020
#' (default) when the data is already transformed with `log10()` or when
21-
#' using `scale_y_log10`. It should be `FALSE` when using
21+
#' using `scale_y_log10()`. It should be `FALSE` when using
2222
#' `coord_trans(y = "log10")`.
2323
#' @param colour Colour of the tick marks.
2424
#' @param size Thickness of tick marks, in mm.

R/coord-.r

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#' @section Coordinate systems:
22
#'
3-
#' All `coord_*` functions (like `coord_trans`) return a `Coord*`
3+
#' All `coord_*()` functions (like `coord_trans()`) return a `Coord*`
44
#' object (like `CoordTrans`).
55
#'
66
#' Each of the `Coord*` objects is a [ggproto()] object,

R/coord-map.r

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#' `coord_map()` projects a portion of the earth, which is approximately
44
#' spherical, onto a flat 2D plane using any projection defined by the
55
#' `mapproj` package. Map projections do not, in general, preserve straight
6-
#' lines, so this requires considerable computation. `coord_quickmap` is a
6+
#' lines, so this requires considerable computation. `coord_quickmap()` is a
77
#' quick approximation that does preserve straight lines. It works best for
88
#' smaller areas closer to the equator.
99
#'

R/facet-.r

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ NULL
3131
#' turn and is expected to supply a `PANEL` column mapping each row to a
3232
#' panel defined in the layout. Additionally this method can also add or
3333
#' subtract data points as needed e.g. in the case of adding margins to
34-
#' `facet_grid`.
34+
#' `facet_grid()`.
3535
#'
3636
#' - `draw_panels`: This is where the panels are assembled into a
3737
#' `gtable` object. The method receives, among others, a list of grobs
@@ -494,8 +494,8 @@ max_width <- function(grobs, value_only = FALSE) {
494494
#' Find panels in a gtable
495495
#'
496496
#' These functions help detect the placement of panels in a gtable, if they are
497-
#' named with "panel" in the beginning. `find_panel` returns the extend of
498-
#' the panel area, while `panel_cols` and `panel_rows` returns the
497+
#' named with "panel" in the beginning. `find_panel()` returns the extend of
498+
#' the panel area, while `panel_cols()` and `panel_rows()` returns the
499499
#' columns and rows that contains panels respectively.
500500
#'
501501
#' @param table A gtable

R/facet-wrap.r

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,7 @@ FacetWrap <- ggproto("FacetWrap", Facet,
393393
#'
394394
#' Cleans up the input to be an integer greater than or equal to one, or
395395
#' `NULL`. Intended to be used on the `nrow` and `ncol`
396-
#' arguments of `facet_wrap`.
396+
#' arguments of `facet_wrap()`.
397397
#' @param n Hopefully an integer greater than or equal to one, or `NULL`,
398398
#' though other inputs are handled.
399399
#' @return An integer greater than or equal to one, or `NULL`.

R/fortify.r

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#' Fortify a model with data.
22
#'
33
#' Rather than using this function, I now recommend using the \pkg{broom}
4-
#' package, which implements a much wider range of methods. `fortify`
4+
#' package, which implements a much wider range of methods. `fortify()`
55
#' may be deprecated in the future.
66
#'
77
#' @seealso [fortify.lm()]

R/geom-.r

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ NULL
33

44
#' @section Geoms:
55
#'
6-
#' All `geom_*` functions (like `geom_point`) return a layer that
6+
#' All `geom_*()` functions (like `geom_point()`) return a layer that
77
#' contains a `Geom*` object (like `GeomPoint`). The `Geom*`
88
#' object is responsible for rendering the data in the plot.
99
#'

R/geom-bin2d.r

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#' @inheritParams layer
1212
#' @inheritParams geom_point
1313
#' @param geom,stat Use to override the default connection between
14-
#' `geom_bin2d` and `stat_bin2d`.
14+
#' `geom_bin2d()` and `stat_bin2d()`.
1515
#' @seealso [stat_binhex()] for hexagonal binning
1616
#' @examples
1717
#' d <- ggplot(diamonds, aes(x, y)) + xlim(4, 10) + ylim(4, 10)

R/geom-boxplot.r

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
#' @inheritParams layer
3333
#' @inheritParams geom_bar
3434
#' @param geom,stat Use to override the default connection between
35-
#' `geom_boxplot` and `stat_boxplot`.
35+
#' `geom_boxplot()` and `stat_boxplot()`.
3636
#' @param outlier.colour,outlier.color,outlier.fill,outlier.shape,outlier.size,outlier.stroke,outlier.alpha
3737
#' Default aesthetics for outliers. Set to `NULL` to inherit from the
3838
#' aesthetics used for the box.

R/geom-count.r

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
#'
77
#' @eval rd_aesthetics("geom", "point")
88
#' @param geom,stat Use to override the default connection between
9-
#' `geom_count` and `stat_sum`.
9+
#' `geom_count()` and `stat_sum()`.
1010
#' @seealso For continuous `x` and `y`, use [geom_bin2d()].
1111
#' @inheritParams layer
1212
#' @inheritParams geom_point

R/geom-density.r

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
#' @inheritParams geom_bar
1515
#' @inheritParams geom_ribbon
1616
#' @param geom,stat Use to override the default connection between
17-
#' `geom_density` and `stat_density`.
17+
#' `geom_density()` and `stat_density()`.
1818
#' @export
1919
#' @examples
2020
#' ggplot(diamonds, aes(carat)) +

R/geom-density2d.r

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
#' how contours are drawn; [geom_bin2d()] for another way of dealing with
1313
#' overplotting.
1414
#' @param geom,stat Use to override the default connection between
15-
#' `geom_density_2d` and `stat_density_2d`.
15+
#' `geom_density_2d()` and `stat_density_2d()`.
1616
#' @inheritParams layer
1717
#' @inheritParams geom_point
1818
#' @inheritParams geom_path

R/geom-hex.r

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
#'
88
#' @eval rd_aesthetics("geom", "hex")
99
#' @seealso [stat_bin2d()] for rectangular binning
10-
#' @param geom,stat Override the default connection between `geom_hex` and
11-
#' `stat_binhex.`
10+
#' @param geom,stat Override the default connection between `geom_hex()` and
11+
#' `stat_binhex()`.
1212
#' @export
1313
#' @inheritParams layer
1414
#' @inheritParams geom_point

R/geom-histogram.r

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
#' one change at a time. You may need to look at a few options to uncover
1818
#' the full story behind your data.
1919
#'
20-
#' In addition to `geom_histogram`, you can create a histogram plot by using
20+
#' In addition to `geom_histogram()`, you can create a histogram plot by using
2121
#' `scale_x_binned()` with [geom_bar()]. This method by default plots tick marks
2222
#' in between each bar.
2323
#'
@@ -43,8 +43,8 @@
4343
#' ggplot(diamonds, aes(y = carat)) +
4444
#' geom_histogram()
4545
#'
46-
#' # For histograms with tick marks between each bin, use `geom_bar` with
47-
#' # `scale_x_binned`.
46+
#' # For histograms with tick marks between each bin, use `geom_bar()` with
47+
#' # `scale_x_binned()`.
4848
#' ggplot(diamonds, aes(carat)) +
4949
#' geom_bar() +
5050
#' scale_x_binned()

R/geom-path.r

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
#' [geom_polygon()]: Filled paths (polygons);
2323
#' [geom_segment()]: Line segments
2424
#' @section Missing value handling:
25-
#' `geom_path()`, `geom_line()`, and `geom_step` handle `NA` as follows:
25+
#' `geom_path()`, `geom_line()`, and `geom_step()` handle `NA` as follows:
2626
#'
2727
#' * If an `NA` occurs in the middle of a line, it breaks the line. No warning
2828
#' is shown, regardless of whether `na.rm` is `TRUE` or `FALSE`.

R/geom-quantile.r

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#' @param method.args List of additional arguments passed on to the modelling
1212
#' function defined by `method`.
1313
#' @param geom,stat Use to override the default connection between
14-
#' `geom_quantile` and `stat_quantile`.
14+
#' `geom_quantile()` and `stat_quantile()`.
1515
#' @examples
1616
#' m <- ggplot(mpg, aes(displ, 1 / hwy)) + geom_point()
1717
#' m + geom_quantile()

R/geom-segment.r

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
#' Line segments and curves
22
#'
33
#' `geom_segment()` draws a straight line between points (x, y) and
4-
#' (xend, yend). `geom_curve` draws a curved line. See the underlying
4+
#' (xend, yend). `geom_curve()` draws a curved line. See the underlying
55
#' drawing function [grid::curveGrob()] for the parameters that
66
#' control the curve.
77
#'
8-
#' Both geoms draw a single segment/curve per case. See `geom_path` if you
8+
#' Both geoms draw a single segment/curve per case. See `geom_path()` if you
99
#' need to connect points across multiple cases.
1010
#'
1111
#' @eval rd_aesthetics("geom", "segment")

R/geom-tile.r

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#' parameterised differently: `geom_rect()` uses the locations of the four
55
#' corners (`xmin`, `xmax`, `ymin` and `ymax`), while
66
#' `geom_tile()` uses the center of the tile and its size (`x`,
7-
#' `y`, `width`, `height`). `geom_raster` is a high
7+
#' `y`, `width`, `height`). `geom_raster()` is a high
88
#' performance special case for when all the tiles are the same size.
99
#'
1010
#' @eval rd_aesthetics("geom", "tile")

R/geom-violin.r

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
#' @param trim If `TRUE` (default), trim the tails of the violins
1616
#' to the range of the data. If `FALSE`, don't trim the tails.
1717
#' @param geom,stat Use to override the default connection between
18-
#' `geom_violin` and `stat_ydensity`.
18+
#' `geom_violin()` and `stat_ydensity()`.
1919
#' @export
2020
#' @references Hintze, J. L., Nelson, R. D. (1998) Violin Plots: A Box
2121
#' Plot-Density Trace Synergism. The American Statistician 52, 181-184.

R/ggproto.r

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#' Create a new ggproto object
22
#'
3-
#' Construct a new object with `ggproto`, test with `is.proto`,
4-
#' and access parent methods/fields with `ggproto_parent`.
3+
#' Construct a new object with `ggproto()`, test with `is.ggproto()`,
4+
#' and access parent methods/fields with `ggproto_parent()`.
55
#'
66
#' ggproto implements a protype based OO system which blurs the lines between
77
#' classes and instances. It is inspired by the proto package, but it has some

R/plot.r

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
#'
88
#' `ggplot()` is used to construct the initial plot object,
99
#' and is almost always followed by `+` to add component to the
10-
#' plot. There are three common ways to invoke `ggplot`:
10+
#' plot. There are three common ways to invoke `ggplot()`:
1111
#'
1212
#' * `ggplot(df, aes(x, y, other aesthetics))`
1313
#' * `ggplot(df)`

R/position-.r

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#' @section Positions:
22
#'
3-
#' All `position_*` functions (like `position_dodge`) return a
3+
#' All `position_*()` functions (like `position_dodge()`) return a
44
#' `Position*` object (like `PositionDodge`). The `Position*`
55
#' object is responsible for adjusting the position of overlapping geoms.
66
#'

R/quick-plot.r

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
#' @param facets faceting formula to use. Picks [facet_wrap()] or
1414
#' [facet_grid()] depending on whether the formula is one-
1515
#' or two-sided
16-
#' @param margins See `facet_grid`: display marginal facets?
16+
#' @param margins See `facet_grid()`: display marginal facets?
1717
#' @param geom Character vector specifying geom(s) to draw. Defaults to
1818
#' "point" if x and y are specified, and "histogram" if only x is specified.
1919
#' @param stat,position DEPRECATED.

R/save.r

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
#' If not supplied, uses the size of current graphics device.
3636
#' @param dpi Plot resolution. Also accepts a string input: "retina" (320),
3737
#' "print" (300), or "screen" (72). Applies only to raster output types.
38-
#' @param limitsize When `TRUE` (the default), `ggsave` will not
38+
#' @param limitsize When `TRUE` (the default), `ggsave()` will not
3939
#' save images larger than 50x50 inches, to prevent the common error of
4040
#' specifying dimensions in pixels.
4141
#' @param ... Other arguments passed on to the graphics device function,

R/scale-type.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ find_global <- function(name, env, mode = "any") {
4646
#'
4747
#' @param x A vector
4848
#' @return A character vector of scale types. These will be tried in turn
49-
#' to find a default scale. For example, if `scale_type` returns
49+
#' to find a default scale. For example, if `scale_type()` returns
5050
#' `c("foo", "bar")` and the vector is used with the colour aesthetic,
5151
#' ggplot2 will first look for `scale_colour_foo` then
5252
#' `scale_colour_bar`.

R/stat-.r

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#' @section Stats:
22
#'
3-
#' All `stat_*` functions (like `stat_bin`) return a layer that
3+
#' All `stat_*()` functions (like `stat_bin()`) return a layer that
44
#' contains a `Stat*` object (like `StatBin`). The `Stat*`
55
#' object is responsible for rendering the data in the plot.
66
#'

R/stat-count.r

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44
#' \item{prop}{groupwise proportion}
55
#' }
66
#' @seealso [stat_bin()], which bins data in ranges and counts the
7-
#' cases in each range. It differs from `stat_count`, which counts the
7+
#' cases in each range. It differs from `stat_count()`, which counts the
88
#' number of cases at each `x` position (without binning into ranges).
99
#' [stat_bin()] requires continuous `x` data, whereas
10-
#' `stat_count` can be used for both discrete and continuous `x` data.
10+
#' `stat_count()` can be used for both discrete and continuous `x` data.
1111
#'
1212
#' @export
1313
#' @rdname geom_bar

R/stat-qq.r

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@
1212
#' @inheritParams layer
1313
#' @inheritParams geom_point
1414
#' @section Computed variables:
15-
#' Variables computed by `stat_qq`:
15+
#' Variables computed by `stat_qq()`:
1616
#' \describe{
1717
#' \item{sample}{sample quantiles}
1818
#' \item{theoretical}{theoretical quantiles}
1919
#' }
20-
#' Variables computed by `stat_qq_line`:
20+
#' Variables computed by `stat_qq_line()`:
2121
#' \describe{
2222
#' \item{x}{x-coordinates of the endpoints of the line segment connecting the
2323
#' points at the chosen quantiles of the theoretical and the sample

R/theme-current.R

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ NULL
55
#' Get, set, and modify the active theme
66
#'
77
#' The current/active theme (see [theme()]) is automatically applied to every
8-
#' plot you draw. Use `theme_get` to get the current theme, and `theme_set` to
9-
#' completely override it. `theme_update` and `theme_replace` are shorthands for
8+
#' plot you draw. Use `theme_get()` to get the current theme, and `theme_set()` to
9+
#' completely override it. `theme_update()` and `theme_replace()` are shorthands for
1010
#' changing individual elements.
1111
#'
1212
#' @section Adding on to a theme:
@@ -21,9 +21,9 @@ NULL
2121
#' theme not specified in e2 will not be present in the resulting theme (i.e.
2222
#' NULL). Thus this operator can be used to overwrite an entire theme.
2323
#'
24-
#' `theme_update` uses the `+` operator, so that any unspecified values in the
24+
#' `theme_update()` uses the `+` operator, so that any unspecified values in the
2525
#' theme element will default to the values they are set in the theme.
26-
#' `theme_replace` uses `%+replace%` to completely replace the element, so any
26+
#' `theme_replace()` uses `%+replace%` to completely replace the element, so any
2727
#' unspecified values will overwrite the current value in the theme with
2828
#' `NULL`.
2929
#'
@@ -37,7 +37,7 @@ NULL
3737
#'
3838
#' @param ... named list of theme settings
3939
#' @param e1,e2 Theme and element to combine
40-
#' @return `theme_set`, `theme_update`, and `theme_replace`
40+
#' @return `theme_set()`, `theme_update()`, and `theme_replace()`
4141
#' invisibly return the previous theme so you can easily save it, then
4242
#' later restore it.
4343
#' @seealso [+.gg()]

R/theme-defaults.r

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,37 +12,37 @@
1212
#' @details
1313
#' \describe{
1414
#'
15-
#' \item{`theme_gray`}{
15+
#' \item{`theme_gray()`}{
1616
#' The signature ggplot2 theme with a grey background and white gridlines,
1717
#' designed to put the data forward yet make comparisons easy.}
1818
#'
19-
#' \item{`theme_bw`}{
19+
#' \item{`theme_bw()`}{
2020
#' The classic dark-on-light ggplot2 theme. May work better for presentations
2121
#' displayed with a projector.}
2222
#'
23-
#' \item{`theme_linedraw`}{
23+
#' \item{`theme_linedraw()`}{
2424
#' A theme with only black lines of various widths on white backgrounds,
25-
#' reminiscent of a line drawing. Serves a purpose similar to `theme_bw`.
25+
#' reminiscent of a line drawing. Serves a purpose similar to `theme_bw()`.
2626
#' Note that this theme has some very thin lines (<< 1 pt) which some journals
2727
#' may refuse.}
2828
#'
29-
#' \item{`theme_light`}{
30-
#' A theme similar to `theme_linedraw` but with light grey lines and axes,
29+
#' \item{`theme_light()`}{
30+
#' A theme similar to `theme_linedraw()` but with light grey lines and axes,
3131
#' to direct more attention towards the data.}
3232
#'
33-
#' \item{`theme_dark`}{
34-
#' The dark cousin of `theme_light`, with similar line sizes but a dark background. Useful to make thin coloured lines pop out.}
33+
#' \item{`theme_dark()`}{
34+
#' The dark cousin of `theme_light()`, with similar line sizes but a dark background. Useful to make thin coloured lines pop out.}
3535
#'
36-
#' \item{`theme_minimal`}{
36+
#' \item{`theme_minimal()`}{
3737
#' A minimalistic theme with no background annotations.}
3838
#'
39-
#' \item{`theme_classic`}{
39+
#' \item{`theme_classic()`}{
4040
#' A classic-looking theme, with x and y axis lines and no gridlines.}
4141
#'
42-
#' \item{`theme_void`}{
42+
#' \item{`theme_void()`}{
4343
#' A completely empty theme.}
4444
#'
45-
#' \item{`theme_test`}{
45+
#' \item{`theme_test()`}{
4646
#' A theme for visual unit tests. It should ideally never change except
4747
#' for new features.}
4848
#'

0 commit comments

Comments
 (0)