-
Notifications
You must be signed in to change notification settings - Fork 13
/
parse_explore.R
38 lines (31 loc) · 770 Bytes
/
parse_explore.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# parse functions
library(rlang)
gapminder %>% # the data #REVEAL
filter(year == (2000 + 7)) %>% # subset
ggplot() + # pipe to ggplot
aes(x = gdpPercap) +
aes(y = lifeExp) +
# Describing what follows
geom_point() + #REVEAL
aes(color =
paste("continent",
continent)
) ->
my_plot
local_code <- # for testing w/o knitting
"gapminder %>% # the data #REVEAL
filter(year == (2000 + 7)) %>% # subset
ggplot() + # pipe to ggplot
aes(x = gdpPercap) +
aes(y = lifeExp) +
# Describing what follows
geom_point() + #REVEAL
aes(color =
paste(\"continent\",
continent)
) ->
my_plot "
rlang::parse_expr(local_code)
rlang::parse_exprs(local_code)
rlang::parse_quo(local_code)
rlang::parse_quos(local_code)