diff --git a/R/stat-smooth.r b/R/stat-smooth.r index 6dc63cc647..3b3ba735e7 100644 --- a/R/stat-smooth.r +++ b/R/stat-smooth.r @@ -108,7 +108,7 @@ StatSmooth <- ggproto("StatSmooth", Stat, } else { params$formula <- y ~ x } - msg <- c(msg, paste0("formula '", deparse(params$formula), "'")) + msg <- c(msg, paste0("formula = '", deparse(params$formula), "'")) } if (identical(params$method, "gam")) { params$method <- mgcv::gam diff --git a/tests/testthat/test-geom-smooth.R b/tests/testthat/test-geom-smooth.R index a317d78e07..242742763c 100644 --- a/tests/testthat/test-geom-smooth.R +++ b/tests/testthat/test-geom-smooth.R @@ -42,7 +42,7 @@ test_that("default smoothing methods for small and large data sets work", { expect_message( plot_data <- layer_data(p), - "method = 'loess' and formula 'y ~ x'" + "method = 'loess' and formula = 'y ~ x'" ) expect_equal(plot_data$y, as.numeric(out)) @@ -61,7 +61,7 @@ test_that("default smoothing methods for small and large data sets work", { expect_message( plot_data <- layer_data(p), - "method = 'gam' and formula 'y ~ s\\(x, bs = \"cs\"\\)" + "method = 'gam' and formula = 'y ~ s\\(x, bs = \"cs\"\\)" ) expect_equal(plot_data$y, as.numeric(out)) @@ -70,7 +70,7 @@ test_that("default smoothing methods for small and large data sets work", { expect_message( plot_data <- layer_data(p), - "method = 'gam' and formula 'y ~ s\\(x, bs = \"cs\"\\)" + "method = 'gam' and formula = 'y ~ s\\(x, bs = \"cs\"\\)" ) expect_equal(plot_data$y, as.numeric(out)) })