Skip to content

Commit 4d142bb

Browse files
committed
Merge branch master
Merge branch 'tidyverse/master' into label-tag # Conflicts: # NEWS.md # R/facet-.r # R/fortify.r # R/layer.r
2 parents f1ba983 + 1d537ce commit 4d142bb

Some content is hidden

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

51 files changed

+1195
-316
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ addons:
99
- libfreetype6
1010

1111
r:
12-
- 3.1
12+
# - 3.1 # because of tidyr <- tidyselect
1313
- 3.2
1414
- oldrel
1515
- release

DESCRIPTION

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,10 @@ Imports:
1818
gtable (>= 0.1.1),
1919
lazyeval,
2020
MASS,
21+
mgcv,
2122
plyr (>= 1.7.1),
2223
reshape2,
23-
rlang (>= 0.1.6.9002),
24+
rlang (>= 0.2.0.9001),
2425
scales (>= 0.4.1.9002),
2526
stats,
2627
tibble,
@@ -36,7 +37,6 @@ Suggests:
3637
mapproj,
3738
maps,
3839
maptools,
39-
mgcv,
4040
multcomp,
4141
munsell,
4242
nlme,
@@ -52,7 +52,7 @@ Suggests:
5252
Remotes: hadley/scales,
5353
hadley/svglite,
5454
jimhester/withr,
55-
tidyverse/rlang
55+
r-lib/rlang
5656
Enhances: sp
5757
License: GPL-2 | file LICENSE
5858
URL: http://ggplot2.tidyverse.org, https://github.com/tidyverse/ggplot2
@@ -232,6 +232,7 @@ Collate:
232232
'utilities-matrix.r'
233233
'utilities-resolution.r'
234234
'utilities-table.r'
235+
'utilities-tidy-eval.R'
235236
'zxx.r'
236237
'zzz.r'
237238
VignetteBuilder: knitr

NAMESPACE

Lines changed: 32 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,13 @@
22

33
S3method("$",ggproto)
44
S3method("$",ggproto_parent)
5+
S3method("$<-",uneval)
56
S3method("+",gg)
67
S3method("[",uneval)
8+
S3method("[<-",uneval)
79
S3method("[[",ggproto)
10+
S3method("[[<-",uneval)
811
S3method(.DollarNames,ggproto)
9-
S3method(as.character,uneval)
1012
S3method(as.list,ggproto)
1113
S3method(autolayer,default)
1214
S3method(autoplot,default)
@@ -107,12 +109,12 @@ S3method(scale_type,logical)
107109
S3method(scale_type,numeric)
108110
S3method(scale_type,ordered)
109111
S3method(scale_type,sfc)
110-
S3method(str,uneval)
111112
S3method(summary,ggplot)
112113
S3method(widthDetails,titleGrob)
113114
S3method(widthDetails,zeroGrob)
114115
export("%+%")
115116
export("%+replace%")
117+
export(.data)
116118
export(.pt)
117119
export(.stroke)
118120
export(AxisSecondary)
@@ -274,8 +276,16 @@ export(element_grob)
274276
export(element_line)
275277
export(element_rect)
276278
export(element_text)
279+
export(enexpr)
280+
export(enexprs)
281+
export(enquo)
282+
export(enquos)
283+
export(ensym)
284+
export(ensyms)
277285
export(expand_limits)
278286
export(expand_scale)
287+
export(expr)
288+
export(exprs)
279289
export(facet_grid)
280290
export(facet_null)
281291
export(facet_wrap)
@@ -382,6 +392,9 @@ export(position_nudge)
382392
export(position_stack)
383393
export(qplot)
384394
export(quickplot)
395+
export(quo)
396+
export(quo_name)
397+
export(quos)
385398
export(rel)
386399
export(remove_missing)
387400
export(render_axes)
@@ -513,6 +526,8 @@ export(stat_ydensity)
513526
export(summarise_coord)
514527
export(summarise_layers)
515528
export(summarise_layout)
529+
export(sym)
530+
export(syms)
516531
export(theme)
517532
export(theme_bw)
518533
export(theme_classic)
@@ -533,6 +548,7 @@ export(unit)
533548
export(update_geom_defaults)
534549
export(update_labels)
535550
export(update_stat_defaults)
551+
export(vars)
536552
export(waiver)
537553
export(wrap_dims)
538554
export(xlab)
@@ -544,8 +560,21 @@ import(grid)
544560
import(gtable)
545561
import(scales)
546562
importFrom(lazyeval,f_eval)
547-
importFrom(plyr,as.quoted)
548563
importFrom(plyr,defaults)
564+
importFrom(rlang,.data)
565+
importFrom(rlang,enexpr)
566+
importFrom(rlang,enexprs)
567+
importFrom(rlang,enquo)
568+
importFrom(rlang,enquos)
569+
importFrom(rlang,ensym)
570+
importFrom(rlang,ensyms)
571+
importFrom(rlang,expr)
572+
importFrom(rlang,exprs)
573+
importFrom(rlang,quo)
574+
importFrom(rlang,quo_name)
575+
importFrom(rlang,quos)
576+
importFrom(rlang,sym)
577+
importFrom(rlang,syms)
549578
importFrom(stats,setNames)
550579
importFrom(tibble,tibble)
551580
importFrom(utils,.DollarNames)

NEWS.md

Lines changed: 38 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,29 @@
22

33
## New features
44

5-
* `aes()` now supports quasiquotation so that you can use `!!`, `!!!`, and
6-
`:=`. (ggplot2 does not currently support full tidy evaluation because
7-
when I wrote ggplot2 my understanding of NSE was quite flawed, and hence
8-
ggplot2 only captures one environment per plot, not one environment
9-
per aesthetic. We will fix this in a future release.)
5+
* `aes()` now supports quasiquotation so that you can use `!!`, `!!!`,
6+
and `:=`. This replaces `aes_()` and `aes_string()` which are now
7+
soft-deprecated (but will remain around for a long time).
8+
9+
* `facet_wrap()` and `facet_grid()` now support `vars()` inputs. Like
10+
`dplyr::vars()`, this helper quotes its inputs and supports
11+
quasiquotation. For instance you can now supply facetting variables
12+
like this: `facet_wrap(vars(am, cyl))` instead of `facet_wrap(~am +
13+
cyl)`. Note that the formula interface is not going away and will
14+
not be deprecated. `vars()` is simply meant to make it easier to
15+
create functions around `facet_wrap()` and `facet_grid()`.
16+
17+
The first two arguments of `facet_grid()` become `rows` and `cols`
18+
and now support `vars()` inputs. Note however that we took special
19+
care to ensure complete backward compatibility. With this change
20+
`facet_grid(vars(cyl), vars(am, vs))` is equivalent to
21+
`facet_grid(cyl ~ am + vs)` and `facet_grid(cols = vars(am, vs))` is
22+
equivalent to `facet_grid(. ~ am + vs)`.
23+
24+
One nice aspect of the new interface is that you can now easily
25+
supply names: `facet_grid(vars(Cylinder = cyl), labeller =
26+
label_both)` will give nice label titles to the facets. Of course
27+
those names can be unquoted with the usual tidy eval syntax.
1028

1129
* ggplot2 now works on R 3.1 onwards, and uses the
1230
[vdiffr](https://github.com/lionel-/vdiffr) package for visual testing.
@@ -26,6 +44,10 @@
2644
of padding between elements (@karawoo, #2143). A `reverse` parameter allows
2745
you to reverse the placement order of bars and boxes (@karawoo, #2171).
2846

47+
* The `geom_segment()` and `geom_curve()` geoms both have a new
48+
`arrow.fill` parameter which enables specifying a separate fill colour for
49+
closed arrowheads. (@hrbrmstr and @clauswilke, #2375).
50+
2951
* The `expand` argument for `scale_*_continuous()` and `scale_*_discrete()`
3052
now accepts separate expansion values for the lower and upper range
3153
limits. The expansion limits can be specified using the convenience
@@ -84,6 +106,9 @@
84106

85107
* The colorbar shows all colours of the scale (@has2k1, 2343).
86108

109+
* Guides generated by `geom_text()` (e.g. colour) now accept custom labels using
110+
`guide_legend(override.aes = list(label = "foo"))` (@brianwdavis, #2458).
111+
87112
### Margins
88113

89114
* Strips gain margins on all sides by default. This means that to fully justify
@@ -178,6 +203,9 @@ up correct aspect ratio, and draws a graticule.
178203

179204
* In most cases, using `%>%` instead of `+` should generate an informative
180205
error (#2400).
206+
207+
* `layer()` gives considerably better error messages for incorrectly specified
208+
`geom`, `stat`, or `position` (#2401).
181209

182210
* In all layers that use it, `linemitre` now defaults to 10 (instead of 1)
183211
to better match base R.
@@ -274,6 +302,11 @@ up correct aspect ratio, and draws a graticule.
274302
* `ggsave()`'s DPI argument now supports 3 string options: "retina" (320
275303
DPI), "print" (300 DPI), and "screen" (72 DPI) (@foo-bar-baz-qux, #2156).
276304

305+
* Fixed partial argument matches in `ggsave()`. (#2355)
306+
307+
* `ggsave()` now correctly restores the previous graphics device when several
308+
graphics devices are open. (#2363)
309+
277310
* `print.ggplot()` now returns the original ggplot object, instead of the
278311
output from `ggplot_build()`. Also, the object returned from
279312
`ggplot_build()` now has the class `"ggplot_built"`. (#2034)
@@ -286,7 +319,6 @@ up correct aspect ratio, and draws a graticule.
286319

287320
* Update startup messages to reflect new resources. (#2410, @mine-cetinkaya-rundel)
288321

289-
290322
# ggplot2 2.2.1
291323

292324
* Fix usage of `structure(NULL)` for R-devel compatibility (#1968).

R/aes-calculated.r

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ make_labels <- function(mapping) {
9191
if (is.atomic(mapping)) {
9292
aesthetic
9393
} else {
94-
x <- deparse(strip_dots(mapping))
94+
x <- rlang::quo_text(strip_dots(mapping))
9595
if (length(x) > 1) {
9696
x <- paste0(x[[1]], "...")
9797
}

0 commit comments

Comments
 (0)