Skip to content

Commit

Permalink
Add still missing arg_match() calls.
Browse files Browse the repository at this point in the history
  • Loading branch information
aphalo committed Feb 19, 2023
1 parent d15cced commit ba24de2
Show file tree
Hide file tree
Showing 12 changed files with 58 additions and 44 deletions.
8 changes: 4 additions & 4 deletions R/geom-grob.R
Original file line number Diff line number Diff line change
Expand Up @@ -93,12 +93,12 @@
#' @param default.colour A colour definition to use for elements not targeted by
#' the colour aesthetic.
#' @param colour.target A vector of character strings; \code{"all"},
#' \code{"text"}, \code{"box"} and \code{"segment"}.
#' \code{"text"}, \code{"box"} and \code{"segment"} or \code{"none"}.
#' @param default.alpha numeric in [0..1] A transparency value to use for
#' elements not targeted by the alpha aesthetic.
#' @param alpha.target A vector of character strings; \code{"all"},
#' \code{"text"}, \code{"segment"}, \code{"box"}, \code{"box.line"}, and
#' \code{"box.fill"}.
#' \code{"box.fill"} or \code{"none"}.
#' @param add.segments logical Display connecting segments or arrows between
#' original positions and displaced ones if both are available.
#' @param box.padding,point.padding numeric By how much each end of the segments
Expand Down Expand Up @@ -172,9 +172,9 @@ geom_grob <-
nudge_x = 0,
nudge_y = 0,
default.colour = "black",
colour.target = c("all", "grob", "box", "segment", "none"),
colour.target = c("segment", "all", "grob", "box", "none"),
default.alpha = 1,
alpha.target = c("all", "grob", "box", "segment",
alpha.target = c("segment", "all", "grob", "box",
"box.line", "box.fill", "none"),
add.segments = TRUE,
box.padding = 0.25,
Expand Down
8 changes: 6 additions & 2 deletions R/geom-plot.R
Original file line number Diff line number Diff line change
Expand Up @@ -146,9 +146,10 @@ geom_plot <- function(mapping = NULL,
nudge_x = 0,
nudge_y = 0,
default.colour = "black",
colour.target = "segment",
colour.target = c("segment", "all", "box", "none"),
default.alpha = 1,
alpha.target = "segment",
alpha.target = c("segment", "all", "box",
"box.line", "box.fill", "none"),
add.segments = TRUE,
box.padding = 0.25,
point.padding = 1e-06,
Expand All @@ -159,6 +160,9 @@ geom_plot <- function(mapping = NULL,
show.legend = FALSE,
inherit.aes = FALSE) {

colour.target <- rlang::arg_match(colour.target, multiple = TRUE)
alpha.target <- rlang::arg_match(alpha.target, multiple = TRUE)

if (!missing(nudge_x) || !missing(nudge_y)) {
if (!missing(position) && !identical(position, "identity")) {
rlang::abort("You must specify either `position` or `nudge_x`/`nudge_y`.")
Expand Down
13 changes: 8 additions & 5 deletions R/geom-point-linked.r
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,12 @@
#' @param default.colour A colour definition to use for elements not targeted by
#' the colour aesthetic.
#' @param colour.target A vector of character strings; \code{"all"},
#' \code{"text"}, \code{"box"} and \code{"segment"}.
#' \code{"box"} and \code{"segment"} or \code{"none"}.
#' @param default.alpha numeric in [0..1] A transparency value to use for
#' elements not targeted by the alpha aesthetic.
#' @param alpha.target A vector of character strings; \code{"all"},
#' \code{"text"}, \code{"segment"}, \code{"box"}, \code{"box.line"}, and
#' \code{"box.fill"}.
#' \code{"segment"}, \code{"box"}, \code{"box.line"}, and \code{"box.fill"} or
#' \code{"none"}.
#' @param add.segments logical Display connecting segments or arrows between
#' original positions and displaced ones if both are available.
#' @param box.padding,point.padding numeric By how much each end of the segments
Expand Down Expand Up @@ -111,9 +111,9 @@ geom_point_s <- function(mapping = NULL, data = NULL,
nudge_y = 0,
arrow = grid::arrow(length = unit(1/3, "lines")),
default.colour = "black",
colour.target = "point",
colour.target = c("point", "all", "segment", "none"),
default.alpha = 1,
alpha.target = "all",
alpha.target = c("all", "segment", "point", "none"),
add.segments = TRUE,
box.padding = 0.25,
point.padding = 1e-06,
Expand All @@ -123,6 +123,9 @@ geom_point_s <- function(mapping = NULL, data = NULL,
show.legend = NA,
inherit.aes = TRUE) {

colour.target <- rlang::arg_match(colour.target, multiple = TRUE)
alpha.target <- rlang::arg_match(alpha.target, multiple = TRUE)

if (!missing(nudge_x) || !missing(nudge_y)) {
if (!missing(position) && position != "identity") {
rlang::abort("You must specify either `position` or `nudge_x`/`nudge_y`.")
Expand Down
13 changes: 8 additions & 5 deletions R/geom-table.R
Original file line number Diff line number Diff line change
Expand Up @@ -112,12 +112,12 @@
#' @param default.colour A colour definition to use for elements not targeted by
#' the colour aesthetic.
#' @param colour.target A vector of character strings; \code{"all"},
#' \code{"text"}, \code{"box"} and \code{"segment"}.
#' \code{"box"} and \code{"segment"} or \code{"none"}.
#' @param default.alpha numeric in [0..1] A transparency value to use for
#' elements not targeted by the alpha aesthetic.
#' @param alpha.target A vector of character strings; \code{"all"},
#' \code{"text"}, \code{"segment"}, \code{"box"}, \code{"box.line"}, and
#' \code{"box.fill"}.
#' \code{"segment"}, \code{"box"}, \code{"box.line"}, and
#' \code{"box.fill"} or \code{"none"}.
#' @param add.segments logical Display connecting segments or arrows between
#' original positions and displaced ones if both are available.
#' @param box.padding,point.padding numeric By how much each end of the segments
Expand Down Expand Up @@ -227,9 +227,10 @@ geom_table <- function(mapping = NULL, data = NULL,
nudge_x = 0,
nudge_y = 0,
default.colour = "black",
colour.target = "segment",
colour.target = c("segment", "all", "box", "none"),
default.alpha = 1,
alpha.target = "segment",
alpha.target = c("segment", "all", "box",
"box.line", "box.fill", "none"),
add.segments = TRUE,
box.padding = 0.25,
point.padding = 1e-06,
Expand All @@ -245,6 +246,8 @@ geom_table <- function(mapping = NULL, data = NULL,
show.legend = FALSE,
inherit.aes = FALSE) {

colour.target <- rlang::arg_match(colour.target, multiple = TRUE)
alpha.target <- rlang::arg_match(alpha.target, multiple = TRUE)

if (!missing(nudge_x) || !missing(nudge_y)) {
if (!missing(position) && position != "identity") {
Expand Down
5 changes: 3 additions & 2 deletions R/geom-text-linked.r
Original file line number Diff line number Diff line change
Expand Up @@ -110,12 +110,13 @@
#' @param default.colour A colour definition to use for elements not targeted by
#' the colour aesthetic.
#' @param colour.target A vector of character strings; \code{"all"},
#' \code{"text"}, \code{"box"} and \code{"segment"}.
#' \code{"text"}, \code{"segment"}, \code{"box"}, \code{"box.line"}, and
#' \code{"box.fill"} or \code{"none"}.
#' @param default.alpha numeric in [0..1] A transparency value to use for
#' elements not targeted by the alpha aesthetic.
#' @param alpha.target A vector of character strings; \code{"all"},
#' \code{"text"}, \code{"segment"}, \code{"box"}, \code{"box.line"}, and
#' \code{"box.fill"}.
#' \code{"box.fill"} or \code{"none"}.
#' @param add.segments logical Display connecting segments or arrows between
#' original positions and displaced ones if both are available.
#' @param box.padding,point.padding numeric By how much each end of the segments
Expand Down
9 changes: 5 additions & 4 deletions R/stat-dens2d-filter.r
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,11 @@
#' @param these.target character, numeric or logical selecting one or more
#' column(s) of \code{data}. If \code{TRUE} the whole \code{data} object is
#' passed.
#' @param pool.along character, one of \code{"none"} or \code{"x"},
#' indicating if selection should be done pooling the observations along the
#' \emph{x} aesthetic, or separately on either side of \code{xintercept}.
#' @param xintercept,yintercept numeric The split points for the data filtering.
#' @param pool.along character, one of \code{"none"}, \code{"x"}, \code{"y"}, or
#' \code{"xy"} indicating if selection should be done pooling the observations
#' along the \emph{x}, \code{y}, both axes or none based on quadrants given by
#' \code{xintercept} and \code{yintercept}.
#' @param xintercept,yintercept numeric The center point of the quadrants.
#' @param invert.selection logical If \code{TRUE}, the complement of the
#' selected rows are returned.
#' @param h vector of bandwidths for x and y directions. Defaults to normal
Expand Down
8 changes: 4 additions & 4 deletions man/geom_grob.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions man/geom_plot.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions man/geom_point_s.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions man/geom_table.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions man/geom_text_s.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 5 additions & 4 deletions man/stat_dens2d_filter.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit ba24de2

Please sign in to comment.