Skip to content

Commit 2ae36a2

Browse files
authored
seq function calls should use full name of 'length.out' (#3817)
1 parent 0137a4d commit 2ae36a2

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

icons/icons.R

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ write_icon("geom_bar", {
135135

136136
write_icon("geom_bin2d", {
137137
n <- 5
138-
x <- seq(0, 1, length = n + 1)[-(n + 1)]
138+
x <- seq(0, 1, length.out = n + 1)[-(n + 1)]
139139
out <- expand.grid(x = x, y = x)
140140
fill <- sqrt((out$x - 0.5) ^ 2 + (out$y - 0.5) ^ 2)
141141

@@ -239,7 +239,7 @@ write_icon("geom_contour", {
239239
})
240240

241241
write_icon("geom_hex", {
242-
theta <- seq(0, 2 * pi, length = 7)[-1]
242+
theta <- seq(0, 2 * pi, length.out = 7)[-1]
243243
polygonGrob(
244244
0.5 + 0.4 * sin(theta),
245245
0.5 + 0.4 * cos(theta),
@@ -343,8 +343,8 @@ write_icon("geom_ribbon", {
343343
})
344344

345345
write_icon("geom_spoke", {
346-
theta <- seq(0, 2 * pi, length = 10)[-1]
347-
r <- seq(0.1, 0.45, length = length(theta))
346+
theta <- seq(0, 2 * pi, length.out = 10)[-1]
347+
r <- seq(0.1, 0.45, length.out = length(theta))
348348
segmentsGrob(
349349
0.5, 0.5,
350350
0.5 + sin(theta) * r,
@@ -367,7 +367,7 @@ write_icon("geom_density", {
367367

368368

369369
write_icon("geom_rug", {
370-
x <- seq(0.15, 0.95, length = 8)
370+
x <- seq(0.15, 0.95, length.out = 8)
371371
gList(
372372
segmentsGrob(x, 0, x, 0 + 0.1, gp = gpar(lwd = 2)),
373373
segmentsGrob(0, x, 0 + 0.1, x, gp = gpar(lwd = 2))

tests/testthat/test-aes-setting.r

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ test_that("aesthetic parameters match length of data", {
1818
test_that("legend filters out aesthetics not of length 1", {
1919
df <- data_frame(x = 1:5, y = 1:5)
2020
p <- ggplot(df, aes(x, y, colour = factor(x))) +
21-
geom_point(alpha = seq(0, 1, length = 5))
21+
geom_point(alpha = seq(0, 1, length.out = 5))
2222

2323
# Ideally would test something in the legend data structure, but
2424
# that's not easily accessible currently.

tests/testthat/test-geom-quantile.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@ test_that("geom_quantile matches quantile regression", {
1818
data = df
1919
),
2020
tibble::tibble(
21-
x = seq(min(x), max(x), length = 100)
21+
x = seq(min(x), max(x), length.out = 100)
2222
)
2323
)
2424

25-
pred_rq <- cbind(seq(min(x), max(x), length = 100), pred_rq)
25+
pred_rq <- cbind(seq(min(x), max(x), length.out = 100), pred_rq)
2626
colnames(pred_rq) <- c("x", paste("Q", quants * 100, sep = "_"))
2727

2828
ggplot_data <- tibble::as_tibble(layer_data(ps))

0 commit comments

Comments
 (0)