Skip to content

Commit 5f4a4b9

Browse files
committed
replace interleave() with vec_interleave()
1 parent 0cca7a3 commit 5f4a4b9

File tree

5 files changed

+1
-24
lines changed

5 files changed

+1
-24
lines changed

NAMESPACE

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,6 @@ S3method(guide_train,default)
8484
S3method(guide_transform,default)
8585
S3method(heightDetails,titleGrob)
8686
S3method(heightDetails,zeroGrob)
87-
S3method(interleave,default)
88-
S3method(interleave,unit)
8987
S3method(limits,Date)
9088
S3method(limits,POSIXct)
9189
S3method(limits,POSIXlt)

R/geom-violin.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ create_quantile_segment_frame <- function(data, draw_quantiles) {
217217

218218
# We have two rows per segment drawn. Each segment gets its own group.
219219
data_frame0(
220-
x = interleave(violin.xminvs, violin.xmaxvs),
220+
x = vec_interleave(violin.xminvs, violin.xmaxvs),
221221
y = rep(ys, each = 2),
222222
group = rep(ys, each = 2)
223223
)

R/utilities-matrix.R

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,3 @@ cunion <- function(a, b) {
1010

1111
cbind(a, b[setdiff(names(b), names(a))])
1212
}
13-
14-
# Interleave (or zip) multiple units into one vector
15-
interleave <- function(...) UseMethod("interleave")
16-
#' @export
17-
interleave.unit <- function(...) {
18-
units <- lapply(list(...), as.list)
19-
interleaved_list <- interleave.default(!!!units)
20-
inject(unit.c(!!!interleaved_list))
21-
}
22-
#' @export
23-
interleave.default <- function(...) {
24-
vec_interleave(...)
25-
}

tests/testthat/_snaps/utilities.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,3 @@
5050

5151
Only one of `boundary` and `center` may be specified.
5252

53-
# interleave() checks the vector lengths
54-
55-
Can't recycle `..1` (size 4) to match `..2` (size 0).
56-

tests/testthat/test-utilities.R

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -132,10 +132,6 @@ test_that("cut_*() checks its input and output", {
132132
expect_snapshot_error(cut_width(1:10, 1, center = 0, boundary = 0.5))
133133
})
134134

135-
test_that("interleave() checks the vector lengths", {
136-
expect_snapshot_error(interleave(1:4, numeric()))
137-
})
138-
139135
test_that("vec_rbind0 can combined ordered factors", {
140136

141137
withr::local_options(lifecycle_verbosity = "warning")

0 commit comments

Comments
 (0)