Skip to content
This repository was archived by the owner on Feb 10, 2026. It is now read-only.

Commit 6ad88c9

Browse files
authored
Merge pull request #488 from rstudio/tidy-eval
2 parents 4485929 + 209c76c commit 6ad88c9

20 files changed

+179
-311
lines changed

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ Imports:
3333
shiny (>= 0.11.1),
3434
magrittr,
3535
dplyr (>= 0.5.0),
36-
lazyeval,
36+
rlang,
3737
htmltools (>= 0.2.4),
3838
methods
3939
Suggests:

NAMESPACE

Lines changed: 26 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ S3method(apply_scale_defaults,scale_datetime)
88
S3method(apply_scale_defaults,scale_nominal)
99
S3method(apply_scale_defaults,scale_numeric)
1010
S3method(apply_scale_defaults,scale_ordinal)
11-
S3method(arrange_,ggvis)
12-
S3method(arrange_,reactive)
11+
S3method(arrange,ggvis)
12+
S3method(arrange,reactive)
1313
S3method(as.character,prop_band)
1414
S3method(as.character,prop_constant)
1515
S3method(as.character,prop_reactive)
@@ -65,15 +65,13 @@ S3method(constant_vars,grouped_df)
6565
S3method(data_range,character)
6666
S3method(data_range,default)
6767
S3method(data_range,factor)
68-
S3method(distinct_,ggvis)
69-
S3method(distinct_,reactive)
68+
S3method(distinct,ggvis)
69+
S3method(distinct,reactive)
7070
S3method(empty,default)
7171
S3method(explain,ggvis)
7272
S3method(extract_reactives,default)
7373
S3method(extract_reactives,ggvis_props)
7474
S3method(extract_reactives,prop_reactive)
75-
S3method(filter_,ggvis)
76-
S3method(filter_,reactive)
7775
S3method(format,ggvis_axis)
7876
S3method(format,ggvis_legend)
7977
S3method(format,ggvis_props)
@@ -94,14 +92,14 @@ S3method(formula,prop)
9492
S3method(fullseq,Date)
9593
S3method(fullseq,POSIXt)
9694
S3method(fullseq,numeric)
97-
S3method(group_by_,ggvis)
98-
S3method(group_by_,reactive)
95+
S3method(group_by,ggvis)
96+
S3method(group_by,reactive)
9997
S3method(groups,ggvis)
10098
S3method(groups,reactive)
10199
S3method(max_rows,data.frame)
102100
S3method(max_rows,grouped_df)
103-
S3method(mutate_,ggvis)
104-
S3method(mutate_,reactive)
101+
S3method(mutate,ggvis)
102+
S3method(mutate,reactive)
105103
S3method(new_prop,band)
106104
S3method(new_prop,call)
107105
S3method(new_prop,default)
@@ -142,24 +140,24 @@ S3method(prop_vega,prop_variable)
142140
S3method(remove_missing,data.frame)
143141
S3method(remove_missing,default)
144142
S3method(remove_missing,split_df)
145-
S3method(rename_,ggvis)
146-
S3method(rename_,reactive)
143+
S3method(rename,ggvis)
144+
S3method(rename,reactive)
147145
S3method(rep,singular)
148146
S3method(scale_countable,default)
149147
S3method(scale_countable,scale_datetime)
150148
S3method(scale_countable,scale_logical)
151149
S3method(scale_countable,scale_nominal)
152150
S3method(scale_countable,scale_numeric)
153151
S3method(scale_countable,scale_ordinal)
154-
S3method(select_,ggvis)
155-
S3method(select_,reactive)
156-
S3method(slice_,ggvis)
157-
S3method(slice_,reactive)
158-
S3method(summarise_,ggvis)
159-
S3method(summarise_,reactive)
152+
S3method(select,ggvis)
153+
S3method(select,reactive)
154+
S3method(slice,ggvis)
155+
S3method(slice,reactive)
156+
S3method(summarise,ggvis)
157+
S3method(summarise,reactive)
160158
S3method(to_csv,data.frame)
161-
S3method(transmute_,ggvis)
162-
S3method(transmute_,reactive)
159+
S3method(transmute,ggvis)
160+
S3method(transmute,reactive)
163161
S3method(ungroup,ggvis)
164162
S3method(ungroup,reactive)
165163
S3method(value,default)
@@ -309,19 +307,17 @@ export(view_static)
309307
export(waggle)
310308
export(zero_range)
311309
import(assertthat)
312-
importFrom(dplyr,arrange_)
313-
importFrom(dplyr,distinct_)
310+
importFrom(dplyr,arrange)
311+
importFrom(dplyr,distinct)
314312
importFrom(dplyr,explain)
315-
importFrom(dplyr,filter_)
316313
importFrom(dplyr,group_by)
317-
importFrom(dplyr,group_by_)
318314
importFrom(dplyr,groups)
319-
importFrom(dplyr,mutate_)
320-
importFrom(dplyr,rename_)
321-
importFrom(dplyr,select_)
322-
importFrom(dplyr,slice_)
323-
importFrom(dplyr,summarise_)
324-
importFrom(dplyr,transmute_)
315+
importFrom(dplyr,mutate)
316+
importFrom(dplyr,rename)
317+
importFrom(dplyr,select)
318+
importFrom(dplyr,slice)
319+
importFrom(dplyr,summarise)
320+
importFrom(dplyr,transmute)
325321
importFrom(dplyr,ungroup)
326322
importFrom(magrittr,"%>%")
327323
importFrom(shiny,reactive)

NEWS.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# ggvis 0.4.6
22

3+
* Switched from lazyeval to tidy eval (#487).
4+
35
* Fixed #483: Basic example did not work in R 4.0. (#485)
46

57
# ggvis 0.4.5

R/compute_auto_group.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,5 +40,5 @@ auto_group <- function(vis, exclude = NULL) {
4040
if (!any(countable)) return(vis)
4141

4242
group_vars <- lapply(unname(props[countable]), "[[", "value")
43-
dplyr::group_by_(vis, .dots = group_vars)
43+
dplyr::group_by(vis, !!!group_vars)
4444
}

R/compute_stack.R

Lines changed: 9 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ compute_stack.grouped_df <- function(x, stack_var = NULL, group_var = NULL) {
4949

5050
x <- dplyr::ungroup(x)
5151
x <- compute_stack(x, stack_var, group_var)
52-
x <- dplyr::group_by_(x, .dots = old_groups)
52+
x <- dplyr::group_by(x, !!!old_groups)
5353

5454
x
5555
}
@@ -59,28 +59,16 @@ compute_stack.data.frame <- function(x, stack_var = NULL, group_var = NULL) {
5959
assert_that(is.formula(stack_var), is.formula(group_var))
6060

6161
# Round grouping variable to 8 significant digits
62-
gvar <- lazyeval::interp(~round_fp(x), x = group_var[[2]])
63-
x <- dplyr::group_by_(x, group__ = gvar)
62+
x <- dplyr::group_by(x, group__ = round_fp(!!group_var[[2]]))
6463

65-
# FIXME: mutate evaluates in this function's environment, which isn't right.
66-
# This is like mutate(x, stack_upr_ = cumsum(stack_var[[2]]),
67-
# stack_lwr_ = lag(stack_upr_, default = 0))
68-
# but with value of stack_var in the right place.
64+
# Quiet R CMD check note
65+
stack_upr_ <- NULL
6966

70-
# dplyr 0.4.2 overrides lag instead of overriding default method AND
71-
# preserves attributes so we don't want to use base lag
72-
if (utils::packageVersion("dplyr") < "0.4.2") {
73-
args <- list(
74-
stack_upr_ = bquote(cumsum(.(stack_var[[2]]))),
75-
stack_lwr_ = bquote(lag(stack_upr_, default = 0))
76-
)
77-
} else {
78-
args <- list(
79-
stack_upr_ = bquote(cumsum(.(stack_var[[2]]))),
80-
stack_lwr_ = bquote(dplyr::lag(stack_upr_, default = 0))
81-
)
82-
}
83-
x <- dplyr::mutate_(x, .dots = lazyeval::as.lazy_dots(args, asNamespace("ggvis")))
67+
# FIXME: mutate evaluates in this function's environment, which isn't right.
68+
x <- dplyr::mutate(x,
69+
stack_upr_ = cumsum(!!stack_var[[2]]),
70+
stack_lwr_ = dplyr::lag(stack_upr_, default = 0)
71+
)
8472

8573
dplyr::ungroup(x)
8674
}

0 commit comments

Comments
 (0)