diff --git a/R/stat-contour.r b/R/stat-contour.r index f23bc4681d..b07f6a5f5e 100644 --- a/R/stat-contour.r +++ b/R/stat-contour.r @@ -97,7 +97,7 @@ contour_lines <- function(data, breaks, complete = FALSE) { x = xs, y = ys, piece = pieces, - group = groups + group = factor(groups) ), n = length(xs)) } diff --git a/tests/testthat/test-layer.r b/tests/testthat/test-layer.r index bcd3502413..352d41b88a 100644 --- a/tests/testthat/test-layer.r +++ b/tests/testthat/test-layer.r @@ -39,7 +39,7 @@ test_that("missing aesthetics trigger informative error", { }) test_that("if an aes is mapped to a function that returns NULL, it is removed", { - df <- data.frame(x = 1:10) + df <- data_frame(x = 1:10) null <- function(...) NULL p <- cdata(ggplot(df, aes(x, null()))) expect_identical(names(p[[1]]), c("x", "PANEL", "group"))