Description Usage Arguments Value See Also Examples
bd_row
indicates which variables in data are driving the Mahalanobis
distance for a specific row r
, relative to the mean vector of the data.
1 |
data |
numeric data |
row |
row of interest |
n |
number of values to return. By default, will return all variables
(columns) with their respective differences. However, you can choose to view
only the top |
Returns a vector indicating the variables in data
that are driving the
Mahalanobis distance for the respective row.
mahalanobis_distance
for computing the Mahalanobis Distance values
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | ## Not run:
x = matrix(rnorm(200*3), ncol = 10)
colnames(x) = paste0("C", 1:ncol(x))
# compute the relative differences for row 5 and return all variables
x %>%
mahalanobis_distance("bd", normalize = TRUE) %>%
bd_row(5)
# compute the relative differences for row 5 and return the top 3 variables
# that are influencing the Mahalanobis Distance the most
x %>%
mahalanobis_distance("bd", normalize = TRUE) %>%
bd_row(5, 3)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.