Skip to content

Commit

Permalink
make external package links explicit to fix note on devel
Browse files Browse the repository at this point in the history
  • Loading branch information
mjskay committed Jul 26, 2024
1 parent 44c1ec9 commit 650b569
Show file tree
Hide file tree
Showing 64 changed files with 503 additions and 482 deletions.
2 changes: 1 addition & 1 deletion R/cut_cdf_qi.R
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#'
#' @param p A numeric vector of values from a cumulative distribution function,
#' such as values returned by `p`-prefixed distribution functions in base R (e.g. [pnorm()]),
#' the [cdf()] function, or values of the `cdf` computed aesthetic from the
#' the [`cdf()`][distributional::cdf] function, or values of the `cdf` computed aesthetic from the
#' [stat_slabinterval()] family of stats.
#' @param .width vector of probabilities to use that determine the widths of the resulting intervals.
#' @param labels One of:
Expand Down
2 changes: 1 addition & 1 deletion R/geom.R
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ define_orientation_variables = function(orientation) {

#' Base ggproto classes for ggdist
#'
#' @seealso [ggproto]
#' @seealso [`ggproto()`][ggplot2::ggproto]
#' @keywords internal
#' @name ggdist-ggproto
NULL
Expand Down
2 changes: 1 addition & 1 deletion R/geom_dotsinterval.R
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ draw_slabs_dots = function(
#' @inheritParams geom_slabinterval
#' @author Matthew Kay
#' @return A [ggplot2::Geom] or [ggplot2::Stat] representing a dotplot or combined dotplot+interval geometry which can
#' be added to a [ggplot()] object.
#' be added to a [`ggplot()`][ggplot2::ggplot] object.
#' @seealso See the [stat_slabinterval()] family for other
#' stats built on top of [geom_slabinterval()].
#' See `vignette("dotsinterval")` for a variety of examples of use.
Expand Down
21 changes: 11 additions & 10 deletions R/geom_lineribbon.R
Original file line number Diff line number Diff line change
Expand Up @@ -13,31 +13,32 @@ globalVariables(c(".lower", ".upper", ".width"))

#' Line + multiple-ribbon plots (ggplot geom)
#'
#' A combination of [geom_line()] and [geom_ribbon()] with default aesthetics
#' designed for use with output from [point_interval()].
#' A combination of [`geom_line()`][ggplot2::geom_line] and [`geom_ribbon()`][ggplot2::geom_ribbon]
#' with default aesthetics designed for use with output from [point_interval()].
#'
#' @details
#' [geom_lineribbon()] is a combination of a [geom_line()] and [geom_ribbon()] designed for use
#' with output from [point_interval()]. This geom sets some default aesthetics equal to the `.width`
#' column generated by the [point_interval()] family of functions, making them
#' often more convenient than a vanilla [geom_ribbon()] + [geom_line()].
#' [geom_lineribbon()] is a combination of a [`geom_line()`][ggplot2::geom_line] and
#' [`geom_ribbon()`][ggplot2::geom_ribbon] designed for use with output from [point_interval()].
#' This geom sets some default aesthetics equal to the `.width` column generated by the
#' [point_interval()] family of functions, making them often more convenient than a vanilla
#' [`geom_ribbon()`][ggplot2::geom_ribbon] + [`geom_line()`][ggplot2::geom_line].
#'
#' Specifically, [geom_lineribbon()] acts as if its default aesthetics are
#' `aes(fill = forcats::fct_rev(ordered(.width)))`.
#'
#' @eval rd_layer_params("lineribbon")
#' @eval rd_lineribbon_aesthetics("lineribbon")
#' @inheritParams ggplot2::geom_line
#' @param ... Other arguments passed to [layer()]. These are often aesthetics, used to set an aesthetic
#' @param ... Other arguments passed to [`layer()`][ggplot2::layer]. These are often aesthetics, used to set an aesthetic
#' to a fixed value, like `colour = "red"` or `linewidth = 3` (see **Aesthetics**, below). They may also be
#' parameters to the paired geom/stat.
#' @return A [ggplot2::Geom] representing a combined line + multiple-ribbon geometry which can
#' be added to a [ggplot()] object.
#' be added to a [`ggplot()`][ggplot2::ggplot] object.
#' @author Matthew Kay
#' @seealso See [stat_lineribbon()] for a version that does summarizing of samples into points and intervals
#' within ggplot. See [geom_pointinterval()] for a similar geom intended
#' for point summaries and intervals. See [geom_ribbon()] and [geom_line()] for the geoms this is
#' based on.
#' for point summaries and intervals. See [`geom_line()`][ggplot2::geom_line] and
#' [`geom_ribbon()`][ggplot2::geom_ribbon] and for the geoms this is based on.
#' @examples
#'
#' library(dplyr)
Expand Down
29 changes: 15 additions & 14 deletions R/geom_slabinterval.R
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ transform_size = function(size, size_domain, size_range) {
#' specify the endpoints of the interval. A scaling factor for interval line width and point size is applied
#' through the `interval_size_domain`, `interval_size_range`, and `fatten_point` parameters.
#' These scaling factors are designed to give multiple uncertainty intervals reasonable
#' scaling at the default settings for [scale_size_continuous()].
#' scaling at the default settings for [`scale_size_continuous()`][ggplot2::scale_size_continuous].
#'
#' As a combination geom, this geom expects a `datatype` aesthetic specifying which part of the geom a given
#' row in the input data corresponds to: `"slab"` or `"interval"`. However, specifying this aesthetic
Expand All @@ -376,14 +376,14 @@ transform_size = function(size, size_domain, size_range) {
#' @eval rd_layer_params("slabinterval")
#' @eval rd_slabinterval_aesthetics()
#' @inheritParams ggplot2::layer
#' @param ... Other arguments passed to [layer()]. These are often aesthetics, used to set an aesthetic
#' @param ... Other arguments passed to [`layer()`][ggplot2::layer]. These are often aesthetics, used to set an aesthetic
#' to a fixed value, like `colour = "red"` or `linewidth = 3` (see **Aesthetics**, below). They may also be
#' parameters to the paired geom/stat.
#' @param position Position adjustment, either as a string, or the result of a call to a position adjustment function.
#' Setting this equal to `"dodge"` ([position_dodge()]) or `"dodgejust"` ([position_dodgejust()]) can be useful if
#' Setting this equal to `"dodge"` ([`position_dodge()`][ggplot2::position_dodge]) or `"dodgejust"` ([position_dodgejust()]) can be useful if
#' you have overlapping geometries.
#' @return A [ggplot2::Geom] representing a slab or combined slab+interval geometry which can
#' be added to a [ggplot()] object.
#' be added to a [`ggplot()`][ggplot2::ggplot] object.
#' @author Matthew Kay
#' @seealso See [geom_lineribbon()] for a combination geom designed for fit curves plus probability bands.
#' See [geom_dotsinterval()] for a combination geom designed for plotting dotplots with intervals.
Expand Down Expand Up @@ -652,16 +652,17 @@ GeomSlabinterval = ggproto("GeomSlabinterval", AbstractGeom,
documentation for that argument.)
'),
interval_size_range = glue_doc('
A length-2 numeric vector. This geom scales the raw size aesthetic values when drawing interval and point
sizes, as they tend to be too thick when using the default settings of [scale_size_continuous()], which give
sizes with a range of `c(1, 6)`. The `interval_size_domain` value indicates the input domain of raw size
values (typically this should be equal to the value of the `range` argument of the [scale_size_continuous()]
function), and `interval_size_range` indicates the desired output range of the size values (the min and max of
the actual sizes used to draw intervals). Most of the time it is not recommended to change the value of this
argument, as it may result in strange scaling of legends; this argument is a holdover from earlier versions
that did not have size aesthetics targeting the point and interval separately. If you want to adjust the
size of the interval or points separately, you can also use the `linewidth` or `point_size`
aesthetics; see [sub-geometry-scales].
A length-2 numeric vector. This geom scales the raw size aesthetic values when drawing interval
and point sizes, as they tend to be too thick when using the default settings of [`scale_size_continuous()`][ggplot2::scale_size_continuous],
which give sizes with a range of `c(1, 6)`. The `interval_size_domain` value indicates the
input domain of raw size values (typically this should be equal to the value of the `range`
argument of the [`scale_size_continuous()`][ggplot2::scale_size_continuous] function), and
`interval_size_range` indicates the desired output range of the size values (the min and max
of the actual sizes used to draw intervals). Most of the time it is not recommended to change
the value of this argument, as it may result in strange scaling of legends; this argument is
a holdover from earlier versions that did not have size aesthetics targeting the point and
interval separately. If you want to adjust the size of the interval or points separately,
you can also use the `linewidth` or `point_size` aesthetics; see [sub-geometry-scales].
'),
fatten_point = glue_doc('
A multiplicative factor used to adjust the size of the point relative to the size of the
Expand Down
2 changes: 1 addition & 1 deletion R/geom_spike.R
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#' thickness function.
#' @inheritParams geom_slabinterval
#' @return A [ggplot2::Geom] representing a spike geometry which can
#' be added to a [ggplot()] object.
#' be added to a [`ggplot()`][ggplot2::ggplot] object.
#' rd_slabinterval_aesthetics(geom_name),
#' @seealso
#' See [stat_spike()] for the stat version, intended for
Expand Down
2 changes: 1 addition & 1 deletion R/guide_rampbar.R
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#'
#' A colour ramp bar guide that shows continuous colour ramp scales mapped onto
#' values as a smooth gradient. Designed for use with [scale_fill_ramp_continuous()]
#' and [scale_colour_ramp_continuous()]. Based on [guide_colourbar()].
#' and [scale_colour_ramp_continuous()]. Based on [`guide_colourbar()`][ggplot2::guide_colourbar].
#'
#' @inheritDotParams ggplot2::guide_colourbar
#' @param to The color to ramp to in the guide. Corresponds to `1` on the scale.
Expand Down
8 changes: 4 additions & 4 deletions R/parse_dist.R
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,12 @@ globalVariables("prior")
#' - an [environment]: use the given environment
#' @param lb The name of an input column (for `data.frame` and `brms::prior` objects) that contains
#' the lower bound of the distribution, which if present will produce a truncated distribution using
#' [dist_truncated()]. Ignored if `lb` is `NULL` or if `object[[lb]]` is `NA` for the corresponding
#' input row.
#' [`dist_truncated()`][distributional::dist_truncated]. Ignored if `lb` is `NULL` or if `object[[lb]]`
#' is `NA` for the corresponding input row.
#' @param ub The name of an input column (for `data.frame` and `brms::prior` objects) that contains
#' the upper bound of the distribution, which if present will produce a truncated distribution using
#' [dist_truncated()]. Ignored if `ub` is `NULL` or if `object[[ub]]` is `NA` for the corresponding
#' input row.
#' [`dist_truncated()`][distributional::dist_truncated]. Ignored if `ub` is `NULL` or if `object[[ub]]`
#' is `NA` for the corresponding input row.
#' @param to_r_names If `TRUE` (the default), certain common aliases for distribution names are
#' automatically translated into names that R can recognize (i.e., names which have functions starting
#' with `r`, `p`, `q`, and `d` representing random number generators, distribution
Expand Down
2 changes: 1 addition & 1 deletion R/point_interval.R
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ globalVariables(c("y", "ymin", "ymax"))
#' corresponding to the interval. This behavior allows `point_interval`
#' and its derived functions (like `median_qi`, `mean_qi`, `mode_hdi`, etc)
#' to be easily used to plot intervals in ggplot stats using methods like
#' [stat_eye()], [stat_halfeye()], or [stat_summary()].
#' [stat_eye()], [stat_halfeye()], or [`stat_summary()`][ggplot2::stat_summary].
#'
#' `median_qi`, `mode_hdi`, etc are short forms for
#' `point_interval(..., .point = median, .interval = qi)`, etc.
Expand Down
6 changes: 3 additions & 3 deletions R/pr.R
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#' [Pr_()] and [p_()] are an **experimental** mini-language for specifying aesthetic values
#' based on probabilities and probability densities derived from distributions
#' supplied to \pkg{ggdist} stats (e.g., in [stat_slabinterval()],
#' [stat_dotsinterval()], etc.). They generate expressions that use [after_stat()]
#' [stat_dotsinterval()], etc.). They generate expressions that use [`after_stat()`][ggplot2::after_stat]
#' and the computed variables of the stat (such as `cdf` and `pdf`; see e.g.
#' the **Computed Variables** section of [stat_slabinterval()]) to compute
#' the desired probabilities or densities.
Expand All @@ -36,7 +36,7 @@
#'
#' Where `p_(x)` is the probability density function. The use of `!!` is
#' necessary to splice the generated expression into the `aes()` call; for
#' more information, see [quasiquotation].
#' more information, see [quasiquotation][rlang::quasiquotation].
#'
#' @section Probability expressions:
#'
Expand Down Expand Up @@ -69,7 +69,7 @@
#' discrete). It currently does not allow any operators in the expression, and
#' must be passed one of `x`, `y`, or `value`.
#' @seealso The *Computed Variables* section of [stat_slabinterval()] (especially
#' `cdf` and `pdf`) and the [after_stat()] function.
#' `cdf` and `pdf`) and the [`after_stat()`][ggplot2::after_stat] function.
#' @examples
#' library(ggplot2)
#' library(distributional)
Expand Down
2 changes: 1 addition & 1 deletion R/rd.R
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ rd_layer_params = function(geom_name, stat = NULL, as_dots = FALSE) {
if (length(params)) {
if (as_dots) {
glue_doc('
@param ... Other arguments passed to [layer()]. These are often aesthetics, used to set an aesthetic
@param ... Other arguments passed to [`layer()`][ggplot2::layer]. These are often aesthetics, used to set an aesthetic
to a fixed value, like `colour = "red"` or `linewidth = 3` (see **Aesthetics**, below). They may also be
parameters to the paired geom/stat. When paired with the default geom, [geom_<<geom_name>>()],
these include:
Expand Down
4 changes: 2 additions & 2 deletions R/rd_dotsinterval.R
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ rd_dotsinterval_shortcut_geom = function(
rd_layer_params(geom_name, as_dots = FALSE),
glue_doc('
@return A [ggplot2::Geom] representing a <<chart_type>> geometry which can
be added to a [ggplot()] object.
be added to a [`ggplot()`][ggplot2::ggplot] object.
'),
'@template details-dotsinterval-family',
'@template references-quantile-dotplots',
Expand Down Expand Up @@ -108,7 +108,7 @@ rd_dotsinterval_shortcut_stat = function(
'@template details-x-y-xdist-ydist',
glue_doc('
@return A [ggplot2::Stat] representing a <<chart_type>> geometry which can
be added to a [ggplot()] object.'),
be added to a [`ggplot()`][ggplot2::ggplot] object.'),
rd_slabinterval_computed_variables(stat),
rd_dotsinterval_aesthetics(geom_name, stat),
glue_doc('
Expand Down
2 changes: 1 addition & 1 deletion R/rd_lineribbon.R
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ rd_lineribbon_shortcut_stat = function(
'@template details-x-y-xdist-ydist',
glue_doc('
@return A [ggplot2::Stat] representing a <<chart_type>> geometry which can
be added to a [ggplot()] object.'),
be added to a [`ggplot()`][ggplot2::ggplot] object.'),
rd_slabinterval_computed_variables(stat),
rd_lineribbon_aesthetics(geom_name, stat),
glue_doc('
Expand Down
10 changes: 5 additions & 5 deletions R/rd_slabinterval.R
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ rd_slabinterval_shortcut_geom = function(
This geom wraps [geom_slabinterval()] with defaults designed to produce
<<chart_type>> plots. Default aesthetic mappings are applied if the `.width` column
is present in the input data (e.g., as generated by the [point_interval()] family of functions),
making this geom often more convenient than vanilla [ggplot2] geometries when used with
making this geom often more convenient than vanilla [ggplot2][ggplot2::ggplot2] geometries when used with
functions like [median_qi()], [mean_qi()], [mode_hdi()], etc.
Specifically, if `.width` is present in the input, [geom_<<geom_name>>()] acts
Expand All @@ -40,7 +40,7 @@ rd_slabinterval_shortcut_geom = function(
rd_layer_params(geom_name, as_dots = FALSE),
glue_doc('
@return A [ggplot2::Geom] representing a <<chart_type>> geometry which can
be added to a [ggplot()] object.'),
be added to a [`ggplot()`][ggplot2::ggplot] object.'),
rd_slabinterval_aesthetics(geom_name),
glue_doc('
@seealso
Expand Down Expand Up @@ -86,7 +86,7 @@ rd_slabinterval_shortcut_stat = function(
'@template details-x-y-xdist-ydist',
glue_doc('
@return A [ggplot2::Stat] representing a <<chart_type>> geometry which can
be added to a [ggplot()] object.'),
be added to a [`ggplot()`][ggplot2::ggplot] object.'),
rd_slabinterval_computed_variables(stat),
rd_slabinterval_aesthetics(geom_name, stat),
glue_doc('
Expand Down Expand Up @@ -135,8 +135,8 @@ rd_slabinterval_computed_variables = function(stat = StatSlabinterval) {
out = glue_doc('
@section Computed Variables:
The following variables are computed by this stat and made available for
use in aesthetic specifications ([aes()]) using the [after_stat()]
function or the `after_stat` argument of [stage()]:
use in aesthetic specifications ([`aes()`][ggplot2::aes]) using the [`after_stat()`][ggplot2::after_stat]
function or the `after_stat` argument of [`stage()`][ggplot2::stage]:
- `x` or `y`: For slabs, the input values to the slab function.
For intervals, the point summary from the interval function. Whether it is `x` or `y` depends on `orientation`
Expand Down
14 changes: 8 additions & 6 deletions R/scale_.R
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,17 @@
#' \item{`scale_slab_color_* `}{Slab outline color}
#' \item{`scale_slab_fill_* `}{Slab fill color}
#' \item{`scale_slab_alpha_* `}{Slab alpha level / opacity. The default settings of
#' `scale_slab_alpha_continuous` differ from [scale_alpha_continuous()] and
#' are designed for gradient plots (e.g. [stat_gradientinterval()]) by ensuring that
#' `scale_slab_alpha_continuous` differ from [`scale_alpha_continuous()`][ggplot2::scale_alpha_continuous]
#' and are designed for gradient plots (e.g. [stat_gradientinterval()]) by ensuring that
#' densities of 0 get mapped to 0 in the output.}
#' \item{`scale_slab_linewidth_* `}{Slab outline line width}
#' \item{`scale_slab_linetype_* `}{Slab outline line type}
#' \item{`scale_slab_shape_* `}{Slab dot shape (for [geom_dotsinterval()])}
#' }
#'
#' See the corresponding scale documentation in ggplot for more information; e.g.
#' [scale_color_discrete()], [scale_color_continuous()], etc.
#' [`scale_color_discrete()`][ggplot2::scale_color_discrete],
#' [`scale_color_continuous()`][ggplot2::scale_color_continuous], etc.
#'
#' Other scale functions can be used with the aesthetics/scales defined here by using the `aesthetics`
#' argument to that scale function. For example, to use color brewer scales with the `point_color` aesthetic:
Expand All @@ -56,7 +57,7 @@
#' @inheritParams ggplot2::continuous_scale
#' @inheritParams ggplot2::scale_shape
#' @param ... Arguments passed to underlying scale or guide functions. E.g. `scale_point_color_discrete`
#' passes arguments to [scale_color_discrete()]. See those functions for more details.
#' passes arguments to [`scale_color_discrete()`][ggplot2::scale_color_discrete]. See those functions for more details.
#' @param aesthetics Names of aesthetics to set scales for.
#' @param guide Guide to use for legends for an aesthetic.
#' @param range a numeric vector of length 2 that specifies the minimum and maximum size of the plotting symbol
Expand All @@ -65,12 +66,13 @@
#' @param na.value When `na.translate` is true, what value should be shown?
#' @return
#' A [ggplot2::Scale] representing one of the aesthetics used to target the appearance of specific parts of composite
#' `ggdist` geoms. Can be added to a [ggplot()] object.
#' `ggdist` geoms. Can be added to a [`ggplot()`][ggplot2::ggplot] object.
#' @name sub-geometry-scales
#' @aliases scales
#' @author Matthew Kay
#' @family ggdist scales
#' @seealso Other ggplot2 scales: [scale_color_discrete()], [scale_color_continuous()], etc.
#' @seealso Other ggplot2 scales: [`scale_color_discrete()`][ggplot2::scale_color_discrete],
#' [`scale_color_continuous()`][ggplot2::scale_color_continuous], etc.
#' @examples
#'
#' library(dplyr)
Expand Down
Loading

0 comments on commit 650b569

Please sign in to comment.