We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4c1e6ad commit 92cea24Copy full SHA for 92cea24
R/aes.r
@@ -100,6 +100,10 @@ is_position_aes <- function(vars) {
100
#' aes(mpg, wt, col = cyl, fill = NULL)
101
#' aes_string("mpg", "wt", col = "cyl", fill = NULL)
102
#' aes_q(quote(mpg), quote(wt), col = quote(cyl), fill = NULL)
103
+#'
104
+#' aes(col = cyl, fill = NULL)
105
+#' aes_string(col = "cyl", fill = NULL)
106
+#' aes_q(col = quote(cyl), fill = NULL)
107
aes_string <- function(x = NULL, y = NULL, ...) {
108
mapping <- c(compact(list(x = x, y = y)), list(...))
109
mapping[vapply(mapping, is.null, logical(1))] <- "NULL"
@@ -110,8 +114,8 @@ aes_string <- function(x = NULL, y = NULL, ...) {
110
114
111
115
#' @rdname aes_string
112
116
#' @export
113
-aes_q <- function(x, y, ...) {
- mapping <- list(x = x, y = y, ...)
117
+aes_q <- function(x = NULL, y = NULL, ...) {
118
+ mapping <- c(compact(list(x = x, y = y)), list(...))
119
structure(rename_aes(mapping), class = "uneval")
120
}
121
man/aes_string.Rd
@@ -6,7 +6,7 @@
6
\usage{
7
aes_string(x = NULL, y = NULL, ...)
8
9
-aes_q(x, y, ...)
+aes_q(x = NULL, y = NULL, ...)
10
11
\arguments{
12
\item{x,y,...}{List of name value pairs}
@@ -28,6 +28,10 @@ names/calls to define the aesthetic mappings, rather than having to use
28
aes(mpg, wt, col = cyl, fill = NULL)
29
aes_string("mpg", "wt", col = "cyl", fill = NULL)
30
aes_q(quote(mpg), quote(wt), col = quote(cyl), fill = NULL)
31
+
32
+aes(col = cyl, fill = NULL)
33
+aes_string(col = "cyl", fill = NULL)
34
+aes_q(col = quote(cyl), fill = NULL)
35
36
\seealso{
37
\code{\link{aes}}
0 commit comments