View source: R/sdistance.R View source: R/archive/sdistance.R
sdistance | R Documentation |
Shiny app which shows the contribution of each variable to the distance between two observations with interactive variable selection. If dijk is the distance between observations i and j in variable k then the contribution is computed:
sdistance(data, xvar = character(0), ...)
data |
matrix or data.frame |
xvar |
character: names of selected variables for the plot |
... |
unused |
Total variance: var_k/sum(var_k) with var_k the variance of the kth variable
Minimum: dijk==min_k(dijk)
Manhattan: dijk/sum(dijk)
Gower: dijk is rescaled to [0, 1] in each variable and then dijk/sum(dijk)
Euclidean: dijk^2/sum(dijk^2)
Manhattan: dijk/sum(dijk)
Maximum: dijk==max_k(dijk)
nothing
if (interactive()) sdistance(iris)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.