Skip to content

Commit

Permalink
Merge pull request #63 from mayer79/FIX-check-two-by
Browse files Browse the repository at this point in the history
fix check condition for more than one BY variables
  • Loading branch information
mayer79 authored Feb 9, 2024
2 parents 79bdbe5 + 8431513 commit 6017b88
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Depends:
R (>= 3.2.0)
Encoding: UTF-8
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.2.3
RoxygenNote: 7.3.1
Imports:
dplyr (>= 1.1.0),
ggplot2,
Expand Down
4 changes: 4 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@

- `plot.light_effects()` has gained an argument `recode_labels` to modify the curve labels.

## Bug fixes

- More than one "by" variable would raise an error when creating the "flashlight" object, see #62.

## Deprecated functionality

- `add_shap()`: Deprecated in favor of {kernelshap} or {fastshap}.
Expand Down
2 changes: 1 addition & 1 deletion R/light_check.R
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ light_check.flashlight <- function(x, ...) {
}
}
in_colnames <- function(nm) {
if (nm %in% nms && !is.null(x[[nm]]) && !(x[[nm]] %in% colnames(x$data))) {
if (nm %in% nms && !is.null(x[[nm]]) && !all(x[[nm]] %in% colnames(x$data))) {
stop(paste(nm, "needs to be a column in 'data'."))
}
}
Expand Down

0 comments on commit 6017b88

Please sign in to comment.