From ed28759990e3ccb80b6daf9838975920d43ff2ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Wi=C5=9Bniewski?= Date: Tue, 23 Aug 2022 21:29:22 +0200 Subject: [PATCH] changes according to CRAN comments --- NEWS.md | 2 ++ R/plot_density.R | 4 ++-- README.md | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/NEWS.md b/NEWS.md index 0924ca8..0f6b162 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,4 +1,6 @@ # fairmodels 1.2.1 +* changed link to *codecov* in `README.md` +* changed `class(x) == 'fairness_regression_object` to `inherits(x, "fairness_regression_object")` in `plot_density.R` according to CRAN comments * changed CITATION file (added reference to the RJournal) * fix for https://github.com/ModelOriented/fairmodels/issues/49 * fix for https://github.com/ModelOriented/fairmodels/issues/48 diff --git a/R/plot_density.R b/R/plot_density.R index 8360914..7846b03 100644 --- a/R/plot_density.R +++ b/R/plot_density.R @@ -46,7 +46,7 @@ plot_density <- function(x, ...) { } limits <- c(0, 1) - if (class(x) == "fairness_regression_object") limits <- NULL + if (inherits(x, "fairness_regression_object")) limits <- NULL probability <- protected <- label <- NULL p <- ggplot(density_data, aes(probability, protected)) + @@ -64,7 +64,7 @@ plot_density <- function(x, ...) { ggtitle("Density plot") + facet_grid(rows = vars(label)) - if (class(x) == "fairness_regression_object") { + if (inherits(x, "fairness_regression_object")) { p <- p + xlab("predicted values") } diff --git a/README.md b/README.md index ebd467a..c991ef2 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # fairmodels - [![Codecov test coverage](https://codecov.io/gh/ModelOriented/fairmodels/branch/master/graph/badge.svg)](https://codecov.io/gh/ModelOriented/fairmodels?branch=master) + [![Codecov test coverage](https://codecov.io/gh/ModelOriented/fairmodels/branch/master/graph/badge.svg)](https://app.codecov.io/gh/ModelOriented/fairmodels?branch=master) [![R build status](https://github.com/ModelOriented/fairmodels/workflows/R-CMD-check/badge.svg)](https://github.com/ModelOriented/fairmodels/actions) [![CRAN](https://www.r-pkg.org/badges/version/fairmodels)](https://cran.r-project.org/package=fairmodels) ![Downloads](https://cranlogs.r-pkg.org/badges/fairmodels)