dimnames-set-.shapviz: Dimnames (Replacement Method) of "shapviz" Object

dimnames<-.shapvizR Documentation

Dimnames (Replacement Method) of "shapviz" Object

Description

This implies colnames(x) <- ....

Usage

## S3 replacement method for class 'shapviz'
dimnames(x) <- value

Arguments

x

An object of class "shapviz".

value

A list with rownames and column names compliant with SHAP matrix.

Value

Like x, but with replaced dimnames.

See Also

shapviz()

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)
dimnames(x) <- list(1:2, c("a", "b"))
dimnames(x)
colnames(x) <- c("x", "y")
colnames(x)

shapviz documentation built on Sept. 14, 2024, 5:07 p.m.