Skip to content

Commit 7f2ef19

Browse files
klin333teunbrand
authored andcommitted
add stats:: in front of stats functions that were not explicitly imported (#6793)
* add stats:: in front of stats functions that were not explicitly imported * use `vec_ave()`
1 parent 2390be0 commit 7f2ef19

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

R/position-dodge.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,13 +150,13 @@ PositionDodge <- ggproto("PositionDodge", Position,
150150
}
151151

152152
data$order <- xtfrm( # xtfrm makes anything 'sortable'
153-
data$order %||% ave(data$group, data$x, data$PANEL, FUN = match_sorted)
153+
data$order %||% vec_ave(data$group, data[c("x", "PANEL")], fn = match_sorted)
154154
)
155155
if (isTRUE(params$reverse)) {
156156
data$order <- -data$order
157157
}
158158
if (is.null(params$n)) { # preserve = "total"
159-
data$order <- ave(data$order, data$x, data$PANEL, FUN = match_sorted)
159+
data$order <- vec_ave(data$order, data[c("x", "PANEL")], fn = match_sorted)
160160
} else { # preserve = "single"
161161
data$order <- match_sorted(data$order)
162162
}

R/stat-ydensity.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ StatYdensity <- ggproto(
7373
"{.arg quantiles} for weighted data is not implemented."
7474
)
7575
}
76-
quants <- quantile(data$y, probs = quantiles)
76+
quants <- stats::quantile(data$y, probs = quantiles)
7777
quants <- data_frame0(
7878
y = unname(quants),
7979
quantile = quantiles
@@ -82,7 +82,7 @@ StatYdensity <- ggproto(
8282
# Interpolate other metrics
8383
for (var in setdiff(names(dens), names(quants))) {
8484
quants[[var]] <-
85-
approx(dens$y, dens[[var]], xout = quants$y, ties = "ordered")$y
85+
stats::approx(dens$y, dens[[var]], xout = quants$y, ties = "ordered")$y
8686
}
8787

8888
dens <- vec_slice(dens, !dens$y %in% quants$y)

0 commit comments

Comments
 (0)