Skip to content

Commit 17b45f9

Browse files
author
Dana Paige Seidel
authored
Minor documentation edits (#2727)
1 parent 9b640c5 commit 17b45f9

Some content is hidden

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

93 files changed

+350
-356
lines changed

R/aes.r

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ NULL
99
#'
1010
#' This function also standardises aesthetic names by performing partial
1111
#' matching, converting color to colour, and translating old style R names to
12-
#' ggplot names (eg. pch to shape, cex to size).
12+
#' ggplot names (e.g. pch to shape, cex to size).
1313
#'
1414
#' @section Quasiquotation:
1515
#'
@@ -165,7 +165,7 @@ is_position_aes <- function(vars) {
165165
aes_to_scale(vars) %in% c("x", "y")
166166
}
167167

168-
#' Define aesthetic mappings programatically
168+
#' Define aesthetic mappings programmatically
169169
#'
170170
#' Aesthetic mappings describe how variables in the data are mapped to visual
171171
#' properties (aesthetics) of geoms. [aes()] uses non-standard

R/facet-.r

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,9 @@ NULL
6666
#'
6767
#' - `draw_labels`: Given the gtable returned by `draw_panels`,
6868
#' add axis titles to the gtable. The default is to add one title at each side
69-
#' depending on the position and existance of axes.
69+
#' depending on the position and existence of axes.
7070
#'
71-
#' All extension methods recieve the content of the params field as the params
71+
#' All extension methods receive the content of the params field as the params
7272
#' argument, so the constructor function will generally put all relevant
7373
#' information into this field. The only exception is the `shrink`
7474
#' parameter which is used to determine if scales are retrained after Stat

R/facet-grid-.r

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ NULL
103103
#'
104104
#' # Margins ----------------------------------------------------------
105105
#' \donttest{
106-
#' # Margins can be specified by logically (all yes or all no) or by specific
106+
#' # Margins can be specified logically (all yes or all no) or for specific
107107
#' # variables as (character) variable names
108108
#' mg <- ggplot(mtcars, aes(x = mpg, y = wt)) + geom_point()
109109
#' mg + facet_grid(vs + am ~ gear, margins = TRUE)

R/fortify-map.r

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ map_data <- function(map, region = ".", exact = FALSE, ...) {
8585
#' @param regions map region
8686
#' @param fill fill colour
8787
#' @param colour border colour
88-
#' @param xlim,ylim latitudinal and logitudinal range for extracting map
88+
#' @param xlim,ylim latitudinal and longitudinal ranges for extracting map
8989
#' polygons, see [maps::map()] for details.
9090
#' @inheritDotParams geom_polygon
9191
#' @export

R/geom-bar.r

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
#' Bar charts
22
#'
3-
#' There are two types of bar charts: `geom_bar` makes the height of the
3+
#' There are two types of bar charts: `geom_bar()` and `geom_col()`.
4+
#' `geom_bar()` makes the height of the
45
#' bar proportional to the number of cases in each group (or if the
56
#' `weight` aesthetic is supplied, the sum of the weights). If you want the
67
#' heights of the bars to represent values in the data, use
7-
#' \link{geom_col} instead. `geom_bar` uses `stat_count` by
8-
#' default: it counts the number of cases at each x position. `geom_col`
9-
#' uses `stat_identity`: it leaves the data as is.
8+
#' `geom_col()` instead. `geom_bar()` uses `stat_count()` by
9+
#' default: it counts the number of cases at each x position. `geom_col()`
10+
#' uses `stat_identity()`: it leaves the data as is.
1011
#'
1112
#' A bar chart uses height to represent a value, and so the base of the
1213
#' bar must always be shown to produce a valid visual comparison. Naomi Robbins
@@ -25,16 +26,16 @@
2526
#' @seealso
2627
#' [geom_histogram()] for continuous data,
2728
#' [position_dodge()] and [position_dodge2()] for creating side-by-side
28-
#' barcharts.
29+
#' bar charts.
2930
#' @export
3031
#' @inheritParams layer
3132
#' @inheritParams geom_point
3233
#' @param width Bar width. By default, set to 90\% of the resolution of the data.
33-
#' @param binwidth `geom_bar` no longer has a binwidth argument - if
34+
#' @param binwidth `geom_bar()` no longer has a binwidth argument - if
3435
#' you use it you'll get an warning telling to you use
3536
#' [geom_histogram()] instead.
36-
#' @param geom,stat Override the default connection between `geom_bar` and
37-
#' `stat_count`.
37+
#' @param geom,stat Override the default connection between `geom_bar()` and
38+
#' `stat_count()`.
3839
#' @examples
3940
#' # geom_bar is designed to make it easy to create bar charts that show
4041
#' # counts (or sums of weights)

R/geom-boxplot.r

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
#' if the notches of two boxes do not overlap, this suggests that the medians
5050
#' are significantly different.
5151
#' @param notchwidth For a notched box plot, width of the notch relative to
52-
#' the body (default 0.5)
52+
#' the body (defaults to `notchwidth = 0.5`).
5353
#' @param varwidth If `FALSE` (default) make a standard box plot. If
5454
#' `TRUE`, boxes are drawn with widths proportional to the
5555
#' square-roots of the number of observations in the groups (possibly

R/geom-linerange.r

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
#' `geom_pointrange()`.
1010
#' @seealso
1111
#' [stat_summary()] for examples of these guys in use,
12-
#' [geom_smooth()] for continuous analog,
12+
#' [geom_smooth()] for continuous analogue,
1313
#' [geom_errorbarh()] for a horizontal error bar.
1414
#' @export
1515
#' @inheritParams layer

R/geom-point.r

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
#' There is no one solution to this problem, but there are some techniques
1919
#' that can help. You can add additional information with
2020
#' [geom_smooth()], [geom_quantile()] or
21-
#' [geom_density_2d()]. If you have few unique x values,
21+
#' [geom_density_2d()]. If you have few unique `x` values,
2222
#' [geom_boxplot()] may also be useful.
2323
#'
2424
#' Alternatively, you can
@@ -36,7 +36,7 @@
3636
#' a warning. If `TRUE`, missing values are silently removed.
3737
#' @param ... Other arguments passed on to [layer()]. These are
3838
#' often aesthetics, used to set an aesthetic to a fixed value, like
39-
#' `color = "red"` or `size = 3`. They may also be parameters
39+
#' `colour = "red"` or `size = 3`. They may also be parameters
4040
#' to the paired geom/stat.
4141
#' @inheritParams layer
4242
#' @export
@@ -76,12 +76,6 @@
7676
#' geom_point(colour = "pink", size = 4) +
7777
#' geom_point(aes(shape = factor(cyl)))
7878
#'
79-
#' # These extra layers don't usually appear in the legend, but we can
80-
#' # force their inclusion
81-
#' p + geom_point(colour = "black", size = 4.5, show.legend = TRUE) +
82-
#' geom_point(colour = "pink", size = 4, show.legend = TRUE) +
83-
#' geom_point(aes(shape = factor(cyl)))
84-
#'
8579
#' # geom_point warns when missing values have been dropped from the data set
8680
#' # and not plotted, you can turn this off by setting na.rm = TRUE
8781
#' mtcars2 <- transform(mtcars, mpg = ifelse(runif(32) < 0.2, NA, mpg))

R/geom-ribbon.r

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#' by `ymin` and `ymax`. `geom_area` is a special case of
55
#' `geom_ribbon`, where the `ymin` is fixed to 0.
66
#'
7-
#' An area plot is the continuous analog of a stacked bar chart (see
7+
#' An area plot is the continuous analogue of a stacked bar chart (see
88
#' [geom_bar()]), and can be used to show how composition of the
99
#' whole varies over the range of x. Choosing the order in which different
1010
#' components is stacked is very important, as it becomes increasing hard to

R/geom-segment.r

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
#' @inheritParams layer
1313
#' @inheritParams geom_point
1414
#' @param arrow specification for arrow heads, as created by arrow().
15-
#' @param arrow.fill fill color to use for the arrow head (if closed). `NULL`
15+
#' @param arrow.fill fill colour to use for the arrow head (if closed). `NULL`
1616
#' means use `colour` aesthetic.
1717
#' @param lineend Line end style (round, butt, square).
1818
#' @param linejoin Line join style (round, mitre, bevel).

0 commit comments

Comments
 (0)