Skip to content

Commit a3aa281

Browse files
committed
Eliminate warnings in tests
1 parent 7d62ba4 commit a3aa281

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

R/stat-sum.r

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ stat_sum <- function(mapping = NULL, data = NULL,
3333
#' @usage NULL
3434
#' @export
3535
StatSum <- ggproto("StatSum", Stat,
36-
default_aes = aes(size = ..n..),
36+
default_aes = aes(size = ..n.., weight = 1),
3737

3838
required_aes = c("x", "y"),
3939

tests/testthat/test-build.r

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,17 @@ test_that("position aesthetics coerced to correct type", {
3030
})
3131

3232
test_that("non-position aesthetics are mapped", {
33-
l1 <- ggplot(df, aes(x, y, fill = z, colour = z, shape = z, size = z)) +
33+
l1 <- ggplot(df, aes(x, y, fill = z, colour = z, shape = z)) +
3434
geom_point()
35-
d1 <- layer_data(l1, 1)
3635

37-
expect_equal(sort(names(d1)), sort(c("x", "y", "fill", "group",
38-
"colour", "shape", "size", "PANEL", "alpha", "stroke")))
36+
expect_named(
37+
layer_data(l1, 1),
38+
c(
39+
"x", "y", "fill", "group", "colour", "shape", "size", "PANEL",
40+
"alpha", "stroke"
41+
),
42+
ignore.order = TRUE
43+
)
3944

4045
l2 <- l1 + scale_colour_manual(values = c("blue", "red", "yellow"))
4146
d2 <- layer_data(l2, 1)

0 commit comments

Comments
 (0)