Skip to content

Commit edb9c45

Browse files
committed
use tidy eval idioms to replace old idioms
1 parent 3e7155f commit edb9c45

File tree

3 files changed

+9
-11
lines changed

3 files changed

+9
-11
lines changed

R/fortify-map.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,6 @@ map_data <- function(map, region = ".", exact = FALSE, ...) {
133133
borders <- function(database = "world", regions = ".", fill = NA,
134134
colour = "grey50", xlim = NULL, ylim = NULL, ...) {
135135
df <- map_data(database, regions, xlim = xlim, ylim = ylim)
136-
geom_polygon(aes(long, lat, group = group), data = df,
136+
geom_polygon(aes(.data$long, .data$lat, group = .data$group), data = df,
137137
fill = fill, colour = colour, ..., inherit.aes = FALSE)
138138
}

R/plot.R

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -178,18 +178,17 @@ plot_clone <- function(plot) {
178178
#' @export
179179
#' @method print ggplot
180180
#' @examples
181-
#' colours <- list(~class, ~drv, ~fl)
181+
#' colours <- c("class", "drv", "fl")
182182
#'
183183
#' # Doesn't seem to do anything!
184184
#' for (colour in colours) {
185-
#' ggplot(mpg, aes(displ, hwy, colour = colour)) +
185+
#' ggplot(mpg, aes(displ, hwy, colour = .data[[colour]])) +
186186
#' geom_point()
187187
#' }
188188
#'
189-
#' # Works when we explicitly print the plots
190189
#' for (colour in colours) {
191-
#' print(ggplot(mpg, aes(displ, hwy, colour = colour)) +
192-
#' geom_point())
190+
#' print(ggplot(mpg, aes(displ, hwy, colour = .data[[colour]])) +
191+
#' geom_point())
193192
#' }
194193
print.ggplot <- function(x, newpage = is.null(vp), vp = NULL, ...) {
195194
set_last_plot(x)

man/print.ggplot.Rd

Lines changed: 4 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)