[.shapviz {shapviz} | R Documentation |
Subsets "shapviz" Object
Description
Use standard square bracket subsetting to select rows and/or columns of SHAP values, feature values, and SHAP interaction values of a "shapviz" object.
Usage
## S3 method for class 'shapviz'
x[i, j, ...]
Arguments
x |
An object of class "shapviz". |
i |
Row subsetting. |
j |
Column subsetting. |
... |
Currently unused. |
Value
A new object of class "shapviz".
See Also
Examples
S <- matrix(c(1, -1, -1, 1), ncol = 2, dimnames = list(NULL, c("x", "y")))
X <- data.frame(x = c("a", "b"), y = c(100, 10))
x <- shapviz(S, X, baseline = 4)
x[1, "x"]
x[1]
x[c(FALSE, TRUE), ]
x[, "x"]
[Package shapviz version 0.9.3 Index]