diff --git a/tests/testthat/_snaps/vdiffr_check_model/check-homogeneity-default.svg b/tests/testthat/_snaps/vdiffr_check_model/check-homogeneity-default.svg new file mode 100644 index 000000000..608f6ffdd --- /dev/null +++ b/tests/testthat/_snaps/vdiffr_check_model/check-homogeneity-default.svg @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +0.4 +0.8 +1.2 +1.6 + +10 +15 +20 +25 +30 +Fitted values + +|Std. residuals| +Reference line should be flat and horizontal +Homogeneity of Variance +check_homogeneity_default + + diff --git a/tests/testthat/_snaps/vdiffr_check_model/check-homogeneity-modern.svg b/tests/testthat/_snaps/vdiffr_check_model/check-homogeneity-modern.svg new file mode 100644 index 000000000..552e0af28 --- /dev/null +++ b/tests/testthat/_snaps/vdiffr_check_model/check-homogeneity-modern.svg @@ -0,0 +1,105 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +0.4 +0.8 +1.2 +1.6 + +10 +15 +20 +25 +30 +Fitted values + +|Std. residuals| +Reference line should be flat and horizontal +Homogeneity of Variance +check_homogeneity_modern + + diff --git a/tests/testthat/_snaps/vdiffr_check_model/check-model-custom-colors.svg b/tests/testthat/_snaps/vdiffr_check_model/check-model-custom-colors.svg new file mode 100644 index 000000000..798997b26 --- /dev/null +++ b/tests/testthat/_snaps/vdiffr_check_model/check-model-custom-colors.svg @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +-2.5 +0.0 +2.5 +5.0 + +10 +15 +20 +25 +30 +Fitted values +Residuals +Reference line should be flat and horizontal +Linearity +check_model_custom_colors + + diff --git a/tests/testthat/_snaps/vdiffr_check_model/check-model-homogeneity.svg b/tests/testthat/_snaps/vdiffr_check_model/check-model-homogeneity.svg new file mode 100644 index 000000000..f6c273b63 --- /dev/null +++ b/tests/testthat/_snaps/vdiffr_check_model/check-model-homogeneity.svg @@ -0,0 +1,119 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +0.4 +0.8 +1.2 +1.6 + +10 +15 +20 +25 +Fitted values + +|Std. residuals| +Reference line should be flat and horizontal +Homogeneity of Variance +check_model_homogeneity + + diff --git a/tests/testthat/_snaps/vdiffr_check_model/check-model-large-linearity.svg b/tests/testthat/_snaps/vdiffr_check_model/check-model-large-linearity.svg new file mode 100644 index 000000000..4751f84ff --- /dev/null +++ b/tests/testthat/_snaps/vdiffr_check_model/check-model-large-linearity.svg @@ -0,0 +1,5090 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +-4 +-2 +0 +2 +4 + +-0.02 +-0.01 +0.00 +0.01 +Fitted values +Residuals +Reference line should be flat and horizontal +Linearity +check_model_large_linearity + + diff --git a/tests/testthat/_snaps/vdiffr_check_model/check-model-large-qq.svg b/tests/testthat/_snaps/vdiffr_check_model/check-model-large-qq.svg new file mode 100644 index 000000000..3fc57a5e0 --- /dev/null +++ b/tests/testthat/_snaps/vdiffr_check_model/check-model-large-qq.svg @@ -0,0 +1,5086 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +-2 +0 +2 +4 + +-4 +-2 +0 +2 +4 +Standard Normal Distribution Quantiles +Sample Quantile Deviations +Dots should fall along the line +Normality of Residuals +check_model_large_qq + + diff --git a/tests/testthat/_snaps/vdiffr_check_model/check-model-linearity.svg b/tests/testthat/_snaps/vdiffr_check_model/check-model-linearity.svg new file mode 100644 index 000000000..20369dde5 --- /dev/null +++ b/tests/testthat/_snaps/vdiffr_check_model/check-model-linearity.svg @@ -0,0 +1,125 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +-4 +-2 +0 +2 +4 +6 + +10 +15 +20 +25 +Fitted values +Residuals +Reference line should be flat and horizontal +Linearity +check_model_linearity + + diff --git a/tests/testthat/_snaps/vdiffr_check_model/check-model-no-dots.svg b/tests/testthat/_snaps/vdiffr_check_model/check-model-no-dots.svg new file mode 100644 index 000000000..5015b794d --- /dev/null +++ b/tests/testthat/_snaps/vdiffr_check_model/check-model-no-dots.svg @@ -0,0 +1,90 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +-2.5 +0.0 +2.5 +5.0 + +10 +15 +20 +25 +30 +Fitted values +Residuals +Reference line should be flat and horizontal +Linearity +check_model_no_dots + + diff --git a/tests/testthat/_snaps/vdiffr_check_model/check-model-outliers.svg b/tests/testthat/_snaps/vdiffr_check_model/check-model-outliers.svg new file mode 100644 index 000000000..78692302c --- /dev/null +++ b/tests/testthat/_snaps/vdiffr_check_model/check-model-outliers.svg @@ -0,0 +1,132 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +17 +20 +18 +31 +21 + + +0.8 +0.8 + + + +-5 +0 +5 + +0.0 +0.1 +0.2 +0.3 +0.4 +Leverage ( +h +i +i +) +Std. Residuals +Points should be inside the contour lines +Influential Observations +check_model_outliers + + diff --git a/tests/testthat/_snaps/vdiffr_check_model/check-model-panel.svg b/tests/testthat/_snaps/vdiffr_check_model/check-model-panel.svg new file mode 100644 index 000000000..2d08c5b12 --- /dev/null +++ b/tests/testthat/_snaps/vdiffr_check_model/check-model-panel.svg @@ -0,0 +1,559 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +0.00 +0.02 +0.04 +0.06 + +10 +20 +30 +mpg +Density + + + +Observed data +Model-predicted data +Model-predicted lines should resemble observed data line +Posterior Predictive Check + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +-4 +-2 +0 +2 +4 +6 + +10 +15 +20 +25 +Fitted values +Residuals +Reference line should be flat and horizontal +Linearity + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +0.4 +0.8 +1.2 +1.6 + +10 +15 +20 +25 +Fitted values + +|Std. residuals| +Reference line should be flat and horizontal +Homogeneity of Variance + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +17 +20 +18 +31 +21 + + +0.8 +0.8 + + + +-5 +0 +5 + +0.0 +0.1 +0.2 +0.3 +0.4 +Leverage ( +h +i +i +) +Std. Residuals +Points should be inside the contour lines +Influential Observations + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +1 +2 +3 +5 +10 + +cyl +hp +wt +Variance Inflation +Factor (VIF, log-scaled) + + + +Low (< 5) +High collinearity (VIF) may inflate parameter uncertainty +Collinearity + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +-1 +0 +1 +2 + +-2 +-1 +0 +1 +2 +Standard Normal Distribution Quantiles +Sample Quantile Deviations +Dots should fall along the line +Normality of Residuals +check_model_panel + + diff --git a/tests/testthat/_snaps/vdiffr_check_model/check-model-qq.svg b/tests/testthat/_snaps/vdiffr_check_model/check-model-qq.svg new file mode 100644 index 000000000..66e0c9cf1 --- /dev/null +++ b/tests/testthat/_snaps/vdiffr_check_model/check-model-qq.svg @@ -0,0 +1,119 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +-1 +0 +1 +2 + +-2 +-1 +0 +1 +2 +Standard Normal Distribution Quantiles +Sample Quantile Deviations +Dots should fall along the line +Normality of Residuals +check_model_qq + + diff --git a/tests/testthat/_snaps/vdiffr_check_model/check-model-theme-lucid.svg b/tests/testthat/_snaps/vdiffr_check_model/check-model-theme-lucid.svg new file mode 100644 index 000000000..7f7b198d6 --- /dev/null +++ b/tests/testthat/_snaps/vdiffr_check_model/check-model-theme-lucid.svg @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +-2.5 +0.0 +2.5 +5.0 + +10 +15 +20 +25 +30 +Fitted values +Residuals +Reference line should be flat and horizontal +Linearity +check_model_theme_lucid + + diff --git a/tests/testthat/_snaps/vdiffr_check_model/check-model-theme-modern.svg b/tests/testthat/_snaps/vdiffr_check_model/check-model-theme-modern.svg new file mode 100644 index 000000000..158349407 --- /dev/null +++ b/tests/testthat/_snaps/vdiffr_check_model/check-model-theme-modern.svg @@ -0,0 +1,105 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +-2.5 +0.0 +2.5 +5.0 + +10 +15 +20 +25 +30 +Fitted values +Residuals +Reference line should be flat and horizontal +Linearity +check_model_theme_modern + + diff --git a/tests/testthat/_snaps/vdiffr_check_model/check-model-with-dots.svg b/tests/testthat/_snaps/vdiffr_check_model/check-model-with-dots.svg new file mode 100644 index 000000000..92bed4ff3 --- /dev/null +++ b/tests/testthat/_snaps/vdiffr_check_model/check-model-with-dots.svg @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +-2.5 +0.0 +2.5 +5.0 + +10 +15 +20 +25 +30 +Fitted values +Residuals +Reference line should be flat and horizontal +Linearity +check_model_with_dots + + diff --git a/tests/testthat/_snaps/vdiffr_check_model/check-normality-default.svg b/tests/testthat/_snaps/vdiffr_check_model/check-normality-default.svg new file mode 100644 index 000000000..2db3e6ed7 --- /dev/null +++ b/tests/testthat/_snaps/vdiffr_check_model/check-normality-default.svg @@ -0,0 +1,99 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +-1 +0 +1 +2 + +-2 +-1 +0 +1 +2 +Standard Normal Distribution Quantiles +Sample Quantile Deviations +Dots should fall along the line +Normality of Residuals + + diff --git a/tests/testthat/_snaps/vdiffr_check_model/check-normality-detrend.svg b/tests/testthat/_snaps/vdiffr_check_model/check-normality-detrend.svg new file mode 100644 index 000000000..2db3e6ed7 --- /dev/null +++ b/tests/testthat/_snaps/vdiffr_check_model/check-normality-detrend.svg @@ -0,0 +1,99 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +-1 +0 +1 +2 + +-2 +-1 +0 +1 +2 +Standard Normal Distribution Quantiles +Sample Quantile Deviations +Dots should fall along the line +Normality of Residuals + + diff --git a/tests/testthat/_snaps/vdiffr_check_model/check-outliers-default.svg b/tests/testthat/_snaps/vdiffr_check_model/check-outliers-default.svg new file mode 100644 index 000000000..7183ad934 --- /dev/null +++ b/tests/testthat/_snaps/vdiffr_check_model/check-outliers-default.svg @@ -0,0 +1,133 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +21 +17 +20 +18 +25 + + +0.9 +0.9 + + + +-8 +-4 +0 +4 +8 + +0.0 +0.1 +0.2 +0.3 +Leverage ( +h +i +i +) +Std. Residuals +Points should be inside the contour lines +Influential Observations +check_outliers_default + + diff --git a/tests/testthat/_snaps/vdiffr_check_model/check-outliers-modern.svg b/tests/testthat/_snaps/vdiffr_check_model/check-outliers-modern.svg new file mode 100644 index 000000000..8f3f7fd1a --- /dev/null +++ b/tests/testthat/_snaps/vdiffr_check_model/check-outliers-modern.svg @@ -0,0 +1,116 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +21 +17 +20 +18 +25 + + +0.9 +0.9 + + + +-8 +-4 +0 +4 +8 + +0.0 +0.1 +0.2 +0.3 +Leverage ( +h +i +i +) +Std. Residuals +Points should be inside the contour lines +Influential Observations +check_outliers_modern + + diff --git a/tests/testthat/test-vdiffr_check_model.R b/tests/testthat/test-vdiffr_check_model.R new file mode 100644 index 000000000..441d16705 --- /dev/null +++ b/tests/testthat/test-vdiffr_check_model.R @@ -0,0 +1,204 @@ +# Snapshot tests for check_model() plots +# These tests verify that diagnostic plots render consistently across versions. +# Related to #236 (snapshot tests) and #420 (large dataset performance). + +# Helper function for reproducible vdiffr tests +expect_doppelganger_with_seed <- function(title, fig, seed = 123) { + set.seed(seed) + vdiffr::expect_doppelganger(title = title, fig = fig) +} + +test_that("plot.see_check_model() renders correctly", { + skip_if_not_installed("performance") + skip_if_not_installed("see") + skip_on_cran() + + set.seed(123) + model <- lm(mpg ~ wt + hp + cyl, data = mtcars) + + # Test linearity check (NCV) + expect_doppelganger_with_seed( + title = "check_model_linearity", + fig = plot(performance::check_model(model, check = "linearity")) + ) + + # Test homogeneity of variance + expect_doppelganger_with_seed( + title = "check_model_homogeneity", + fig = plot(performance::check_model(model, check = "homogeneity")) + ) + + # Test normality (QQ plot) + expect_doppelganger_with_seed( + title = "check_model_qq", + fig = plot(performance::check_model(model, check = "qq")) + ) + + # Test outliers + expect_doppelganger_with_seed( + title = "check_model_outliers", + fig = plot(performance::check_model(model, check = "outliers")) + ) + + # Test full panel plot + expect_doppelganger_with_seed( + title = "check_model_panel", + fig = plot(performance::check_model(model)) + ) +}) + + +test_that("plot.see_check_model() works with themes", { + skip_if_not_installed("performance") + skip_if_not_installed("see") + skip_on_cran() + + set.seed(123) + model <- lm(mpg ~ wt + hp, data = mtcars) + + # Test with modern theme + expect_doppelganger_with_seed( + title = "check_model_theme_modern", + fig = plot(performance::check_model(model, check = "linearity")) + theme_modern() + ) + + # Test with lucid theme + expect_doppelganger_with_seed( + title = "check_model_theme_lucid", + fig = plot(performance::check_model(model, check = "linearity")) + theme_lucid() + ) +}) + + +test_that("plot.see_check_model() works with custom colors", { + skip_if_not_installed("performance") + skip_if_not_installed("see") + skip_on_cran() + + set.seed(123) + model <- lm(mpg ~ wt + hp, data = mtcars) + + # Test with custom colors + expect_doppelganger_with_seed( + title = "check_model_custom_colors", + fig = plot( + performance::check_model(model, check = "linearity"), + colors = c("#1b6ca8", "#cd201f", "#3aaf85") + ) + ) +}) + + +test_that("plot.see_check_normality() renders correctly", { + skip_if_not_installed("performance") + skip_if_not_installed("see") + skip_on_cran() + + set.seed(123) + model <- lm(mpg ~ wt + hp + cyl, data = mtcars) + norm_result <- performance::check_normality(model) + + expect_doppelganger_with_seed( + title = "check_normality_default", + fig = plot(norm_result) + ) + + expect_doppelganger_with_seed( + title = "check_normality_detrend", + fig = plot(norm_result, detrend = TRUE) + ) +}) + + +test_that("plot.see_check_homogeneity() renders correctly", { + skip_if_not_installed("performance") + skip_if_not_installed("see") + skip_on_cran() + + set.seed(123) + model <- lm(mpg ~ wt, data = mtcars) + + # Test homogeneity with default theme + expect_doppelganger_with_seed( + title = "check_homogeneity_default", + fig = plot(performance::check_model(model, check = "homogeneity")) + ) + + # Test with modern theme + expect_doppelganger_with_seed( + title = "check_homogeneity_modern", + fig = plot(performance::check_model(model, check = "homogeneity")) + theme_modern() + ) +}) + + +test_that("plot.see_check_outliers() renders correctly", { + skip_if_not_installed("performance") + skip_if_not_installed("see") + skip_on_cran() + + set.seed(123) + model <- lm(mpg ~ wt + cyl + gear + disp, data = mtcars) + + # Test outliers with default theme + expect_doppelganger_with_seed( + title = "check_outliers_default", + fig = plot(performance::check_model(model, check = "outliers")) + ) + + # Test with modern theme + expect_doppelganger_with_seed( + title = "check_outliers_modern", + fig = plot(performance::check_model(model, check = "outliers")) + theme_modern() + ) +}) + + +test_that("plot.see_check_model() handles large datasets efficiently", { + skip_if_not_installed("performance") + skip_if_not_installed("see") + skip_on_cran() + + # Test that sampling produces consistent plots with larger datasets + set.seed(123) + large_data <- data.frame( + x = rnorm(5000), + y = rnorm(5000) + 0.3 * rnorm(5000), + z = rnorm(5000) + ) + model_large <- lm(y ~ x + z, data = large_data) + + # Test linearity with large dataset + expect_doppelganger_with_seed( + title = "check_model_large_linearity", + fig = plot(performance::check_model(model_large, check = "linearity")) + ) + + # Test QQ plot with large dataset + expect_doppelganger_with_seed( + title = "check_model_large_qq", + fig = plot(performance::check_model(model_large, check = "qq")) + ) +}) + + +test_that("plot.see_check_model() works with show_dots parameter", { + skip_if_not_installed("performance") + skip_if_not_installed("see") + skip_on_cran() + + set.seed(123) + model <- lm(mpg ~ wt + hp, data = mtcars) + + # Test without dots + expect_doppelganger_with_seed( + title = "check_model_no_dots", + fig = plot(performance::check_model(model, check = "linearity", show_dots = FALSE)) + ) + + # Test with dots + expect_doppelganger_with_seed( + title = "check_model_with_dots", + fig = plot(performance::check_model(model, check = "linearity", show_dots = TRUE)) + ) +})