Skip to content

Commit d4695a7

Browse files
authored
Merge 5458cf6 into 3007aae
2 parents 3007aae + 5458cf6 commit d4695a7

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

NEWS.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,11 @@
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.
13+
14+
## Bug fixes
15+
16+
- `sv_dependence2D()`: In case `add_vars` are passed, `x` and/or `y` are removed from it in order to not use any variable twice. [#116](https://github.com/ModelOriented/shapviz/pull/116).
17+
- `split.shapviz()` now drops empty levels. They launched an error because empty "shapviz" objects are currently not supported. [#117](https://github.com/ModelOriented/shapviz/pull/117)
1418

1519
# shapviz 0.9.2
1620

R/methods.R

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,8 @@ c.shapviz <- function(...) {
354354
#'
355355
#' @param x Object of class "shapviz".
356356
#' @param f Vector used to split feature values and SHAP (interaction) values.
357-
#' @param ... Arguments passed to `split()`.
357+
#' @param ... Arguments passed to `split()`. Don't pass `drop = TRUE` as empty
358+
#' "shapviz" objects are rejected.
358359
#' @returns A "mshapviz" object.
359360
#' @examples
360361
#' \dontrun{
@@ -367,7 +368,7 @@ c.shapviz <- function(...) {
367368
#' @export
368369
#' @seealso [shapviz()], [rbind.shapviz()]
369370
split.shapviz <- function(x, f, ...) {
370-
ind <- split(seq_len(nrow(x)), f = f, ...)
371+
ind <- split(seq_len(nrow(x)), f = f, drop = FALSE, ...)
371372
mshapviz(lapply(ind, function(i) x[i, ]))
372373
}
373374

man/split.shapviz.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)