From ca0b7595683f6b2d5ca3dfea5fd9fb56a65a009a Mon Sep 17 00:00:00 2001 From: rsquaredin Date: Wed, 15 May 2019 23:26:24 +0530 Subject: [PATCH] fixes #36 --- .travis.yml | 2 +- docs/index.html | 12 ++++- tests/figs/deps.txt | 8 ++-- tests/figs/test-plots/el-plot.svg | 71 ++++++++++++++++++++++++++++++ tests/figs/test-plots/fl-plot.svg | 55 +++++++++++++++++++++++ tests/figs/test-plots/ml-plot.svg | 69 +++++++++++++++++++++++++++++ tests/figs/test-plots/ql-plot.svg | 69 +++++++++++++++++++++++++++++ tests/figs/test-plots/wl-plot.svg | 73 +++++++++++++++++++++++++++++++ tests/testthat/test-plots.R | 10 ++--- 9 files changed, 357 insertions(+), 12 deletions(-) diff --git a/.travis.yml b/.travis.yml index 035553a..17bda6e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,7 +11,7 @@ matrix: - r: release - r: release os: osx - osx_image: xcode7.3 + osx_image: xcode8.3 before_install: - sudo tlmgr install framed titling - r: devel diff --git a/docs/index.html b/docs/index.html index 03364d4..4ee90ec 100644 --- a/docs/index.html +++ b/docs/index.html @@ -34,7 +34,17 @@ - + + + + diff --git a/tests/figs/deps.txt b/tests/figs/deps.txt index 6cb3f3d..059d357 100644 --- a/tests/figs/deps.txt +++ b/tests/figs/deps.txt @@ -1,5 +1,3 @@ -Fontconfig: 2.11.94 -FreeType: 2.6.0 -Cairo: 1.14.2 -vdiffr: 0.2.3 -svglite: 1.2.1 +- vdiffr-svg-engine: 1.0 +- vdiffr: 0.3.0 +- freetypeharfbuzz: 0.2.5 diff --git a/tests/figs/test-plots/el-plot.svg b/tests/figs/test-plots/el-plot.svg index b590cc4..12ae677 100644 --- a/tests/figs/test-plots/el-plot.svg +++ b/tests/figs/test-plots/el-plot.svg @@ -1 +1,72 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +-2.0 +-1.5 +-1.0 +-0.5 +0.0 + + + + + + + + + + + + + + + +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +Bins +WoE +WoE Trend diff --git a/tests/figs/test-plots/fl-plot.svg b/tests/figs/test-plots/fl-plot.svg index b590cc4..9ff9d57 100644 --- a/tests/figs/test-plots/fl-plot.svg +++ b/tests/figs/test-plots/fl-plot.svg @@ -1 +1,56 @@ + + + + + + + + + + + + + + + + + + + + + + + + +-0.3 +-0.2 +-0.1 +0.0 +0.1 +0.2 + + + + + + + + + + +tertiary +secondary +unknown +primary +Levels +WoE +WoE Trend diff --git a/tests/figs/test-plots/ml-plot.svg b/tests/figs/test-plots/ml-plot.svg index b590cc4..8eff1e2 100644 --- a/tests/figs/test-plots/ml-plot.svg +++ b/tests/figs/test-plots/ml-plot.svg @@ -1 +1,70 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +-0.50 +-0.25 +0.00 +0.25 + + + + + + + + + + + + + + +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +Bins +WoE +WoE Trend diff --git a/tests/figs/test-plots/ql-plot.svg b/tests/figs/test-plots/ql-plot.svg index b590cc4..8eff1e2 100644 --- a/tests/figs/test-plots/ql-plot.svg +++ b/tests/figs/test-plots/ql-plot.svg @@ -1 +1,70 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +-0.50 +-0.25 +0.00 +0.25 + + + + + + + + + + + + + + +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +Bins +WoE +WoE Trend diff --git a/tests/figs/test-plots/wl-plot.svg b/tests/figs/test-plots/wl-plot.svg index b590cc4..90058eb 100644 --- a/tests/figs/test-plots/wl-plot.svg +++ b/tests/figs/test-plots/wl-plot.svg @@ -1 +1,74 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +-0.6 +-0.4 +-0.2 +0.0 +0.2 +0.4 + + + + + + + + + + + + + + + + +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +Bins +WoE +WoE Trend diff --git a/tests/testthat/test-plots.R b/tests/testthat/test-plots.R index ac8dc6e..8e19c4d 100644 --- a/tests/testthat/test-plots.R +++ b/tests/testthat/test-plots.R @@ -4,33 +4,33 @@ test_that("equal length plot is as expected", { skip_on_cran() bins <- rbin_equal_length(mbank, y, age, 10) p <- plot(bins) - vdiffr::expect_doppelganger("el plot", p$plot) + vdiffr::expect_doppelganger("el plot", p) }) test_that("manual plot is as expected", { skip_on_cran() bins <- rbin_manual(mbank, y, age, c(29, 31, 34, 36, 39, 42, 46, 51, 56)) p <- plot(bins) - vdiffr::expect_doppelganger("ml plot", p$plot) + vdiffr::expect_doppelganger("ml plot", p) }) test_that("quantiles plot is as expected", { skip_on_cran() bins <- rbin_quantiles(mbank, y, age, 10) p <- plot(bins) - vdiffr::expect_doppelganger("ql plot", p$plot) + vdiffr::expect_doppelganger("ql plot", p) }) test_that("winsorize plot is as expected", { skip_on_cran() bins <- rbin_winsorize(mbank, y, age, 10, winsor_rate = 0.05) p <- plot(bins) - vdiffr::expect_doppelganger("wl plot", p$plot) + vdiffr::expect_doppelganger("wl plot", p) }) test_that("factor plot is as expected", { skip_on_cran() bins <- rbin_factor(mbank, y, education) p <- plot(bins) - vdiffr::expect_doppelganger("fl plot", p$plot) + vdiffr::expect_doppelganger("fl plot", p) }) \ No newline at end of file