Compute sparse scagnostic measure using MST
sc_sparse(x, y)
# S3 method for default
sc_sparse(x, y)
# S3 method for scree
sc_sparse(x, y = NULL)
# S3 method for igraph
sc_sparse(x, y)
numeric vector of x values
numeric vector of y values
A "numeric" object that gives the plot's sparse score.
require(ggplot2)
require(tidyr)
require(dplyr)
ggplot(datasaurus_dozen, aes(x=x, y=y)) +
geom_point() +
facet_wrap(~dataset, ncol=3, scales = "free")
sc_sparse(datasaurus_dozen_wide$away_x, datasaurus_dozen_wide$away_y)
#> [1] 0.07971039
sc_sparse(datasaurus_dozen_wide$circle_x, datasaurus_dozen_wide$circle_y)
#> [1] 0.05262098
sc_sparse(datasaurus_dozen_wide$dino_x, datasaurus_dozen_wide$dino_y)
#> [1] 0.05368993