diff --git a/DESCRIPTION b/DESCRIPTION index 504ddad..39180a5 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: shapviz Title: SHAP Visualizations -Version: 0.10.2 +Version: 0.10.3 Authors@R: c( person("Michael", "Mayer", , "mayermichael79@gmail.com", role = c("aut", "cre")), person("Adrian", "Stando", , "adrian.j.stando@gmail.com", role = "ctb") diff --git a/NEWS.md b/NEWS.md index ebf71b6..ed60f29 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,9 @@ +# shapviz 0.10.3 + +### Bug fixes + +- Solves compatibility warning with ggplot 4.0. + # shapviz 0.10.2 ### Bug fixes diff --git a/R/sv_force.R b/R/sv_force.R index cd6384b..85909bd 100644 --- a/R/sv_force.R +++ b/R/sv_force.R @@ -124,7 +124,7 @@ sv_force.shapviz <- function( axis.ticks.y = ggplot2::element_blank(), axis.text.y = ggplot2::element_blank() ) + - ggplot2::labs(y = ggplot2::element_blank(), x = "Prediction") + ggplot2::labs(y = NULL, x = "Prediction") if (show_annotation) { p <- p + diff --git a/R/sv_importance.R b/R/sv_importance.R index 16099ac..c8ed8f8 100644 --- a/R/sv_importance.R +++ b/R/sv_importance.R @@ -106,7 +106,7 @@ sv_importance.shapviz <- function( if (is_bar) { p <- ggplot2::ggplot(imp_df, ggplot2::aes(x = value, y = feature)) + ggplot2::geom_bar(fill = fill, width = bar_width, stat = "identity", ...) + - ggplot2::labs(x = "mean(|SHAP value|)", y = ggplot2::element_blank()) + ggplot2::labs(x = "mean(|SHAP value|)", y = NULL) } else { # Prepare data.frame for beeswarm plot S <- get_shap_values(object) @@ -136,9 +136,7 @@ sv_importance.shapviz <- function( bar = !is.null(color_bar_title), ncol = length(unique(df$color)) # Special case of constant feature values ) + - ggplot2::labs( - x = "SHAP value", y = ggplot2::element_blank(), color = color_bar_title - ) + + ggplot2::labs(x = "SHAP value", y = NULL, color = color_bar_title) + ggplot2::theme(legend.box.spacing = grid::unit(0, "pt")) } if (show_numbers) { @@ -212,7 +210,7 @@ sv_importance.mshapviz <- function( position = bar_type, ... ) + - ggplot2::labs(fill = ggplot2::element_blank()) + + ggplot2::labs(fill = NULL) + do.call(ggplot2::scale_fill_viridis_d, viridis_args) + ggplot2::guides(fill = ggplot2::guide_legend(reverse = TRUE)) } else { # facets @@ -222,7 +220,7 @@ sv_importance.mshapviz <- function( } p <- p + ggplot2::xlab("mean(|SHAP value|)") + - ggplot2::ylab(ggplot2::element_blank()) + ggplot2::ylab(NULL) return(p) } diff --git a/R/sv_interaction.R b/R/sv_interaction.R index 774b63a..fb51c63 100644 --- a/R/sv_interaction.R +++ b/R/sv_interaction.R @@ -100,7 +100,7 @@ sv_interaction.shapviz <- function( p <- ggplot2::ggplot(imp_df, ggplot2::aes(x = value, y = feature)) + ggplot2::geom_bar(fill = fill, width = bar_width, stat = "identity", ...) + - ggplot2::labs(x = "mean(|SHAP interaction value|)", y = ggplot2::element_blank()) + ggplot2::labs(x = "mean(|SHAP interaction value|)", y = NULL) return(p) } @@ -134,9 +134,7 @@ sv_interaction.shapviz <- function( ... ) + ggplot2::facet_grid(Variable1 ~ Variable2, switch = "y") + - ggplot2::labs( - x = "SHAP value", y = ggplot2::element_blank(), color = color_bar_title - ) + + ggplot2::labs(x = "SHAP value", y = NULL, color = color_bar_title) + .get_color_scale( viridis_args = viridis_args, bar = !is.null(color_bar_title), diff --git a/R/sv_waterfall.R b/R/sv_waterfall.R index cbe6bc6..78c96f0 100644 --- a/R/sv_waterfall.R +++ b/R/sv_waterfall.R @@ -138,7 +138,7 @@ sv_waterfall.shapviz <- function( axis.line.x = ggplot2::element_line(), axis.ticks.y = ggplot2::element_blank() ) + - ggplot2::labs(y = ggplot2::element_blank(), x = "Prediction") + ggplot2::labs(y = NULL, x = "Prediction") if (show_connection) { p <- p + diff --git a/packaging.R b/packaging.R index dbcb500..df79036 100644 --- a/packaging.R +++ b/packaging.R @@ -15,7 +15,7 @@ library(usethis) use_description( fields = list( Title = "SHAP Visualizations", - Version = "0.10.2", + Version = "0.10.3", Description = "Visualizations for SHAP (SHapley Additive exPlanations), such as waterfall plots, force plots, various types of importance plots, dependence plots, and interaction plots.