Skip to content

Commit 61689f8

Browse files
authored
Merge 25eeb53 into 4192d41
2 parents 4192d41 + 25eeb53 commit 61689f8

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

NEWS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
- `print.shapviz()` now shows top two rows of SHAP matrix.
1111
- Re-activate all unit tests.
1212
- Added "How to contribute" to README.
13+
- `sv_dependence2D()`: In case `add_vars` are passed, `x` and/or `y` are removed from it in order to not use any variable twice.
1314

1415
# shapviz 0.9.2
1516

R/sv_dependence2D.R

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
#' maybe other regional features that can be passed via `add_vars`).
88
#'
99
#' If SHAP interaction values are available, setting `interactions = TRUE` allows
10-
#' to focus on pure interaction effects (multiplied by two).
10+
#' to focus on pure interaction effects (multiplied by two). In this case, `add_vars`
11+
#' has no effect.
1112
#'
1213
#' @importFrom rlang .data
1314
#'
@@ -114,7 +115,7 @@ sv_dependence2D.shapviz <- function(object, x, y,
114115

115116
# Color variable
116117
if (!interactions) {
117-
s <- rowSums(S[, c(x, y, add_vars)])
118+
s <- rowSums(S[, unique(c(x, y, add_vars))]) # unique() if add_vars contains x or y
118119
} else {
119120
s <- S_inter[, x, y]
120121
if (x != y) {

man/sv_dependence2D.Rd

Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)