Compute clumpy scagnostic measure using MST

sc_clumpy(x, y)

# S3 method for scree
sc_clumpy(x, y = NULL)

# S3 method for default
sc_clumpy(x, y)

# S3 method for igraph
sc_clumpy(mymst, x)

Examples

  require(ggplot2)
#> Loading required package: ggplot2
  require(tidyr)
#> Loading required package: tidyr
  require(dplyr)
  data(anscombe_tidy)
  ggplot(anscombe_tidy, aes(x=x, y=y)) +
    geom_point() +
    facet_wrap(~set, ncol=2, scales = "free")

  sc_clumpy(anscombe$x1, anscombe$y1)
#> [1] 0.4072702
  sc_clumpy(anscombe$x2, anscombe$y2)
#> Warning: no non-missing arguments to max; returning -Inf
#> [1] -Inf
  sc_clumpy(anscombe$x3, anscombe$y3)
#> [1] 0.0052194
  sc_clumpy(anscombe$x4, anscombe$y4)
#> Warning: success: collinearities reduced through jitter
#> Warning: dataset started with 3 colinear points, jitter added!
#> [1] 0.7560976

  ggplot(datasaurus_dozen, aes(x=x, y=y)) +
    geom_point() +
    facet_wrap(~dataset, ncol=3, scales = "free")

  sc_clumpy(datasaurus_dozen_wide$away_x, datasaurus_dozen_wide$away_y)
#> [1] 0.9435839
  sc_clumpy(datasaurus_dozen_wide$dino_x, datasaurus_dozen_wide$dino_y)
#> [1] 0.7827477
  sc_clumpy(datasaurus_dozen_wide$dots_x, datasaurus_dozen_wide$dots_y)
#> [1] 0.9991884
  sc_clumpy(datasaurus_dozen_wide$h_lines_x, datasaurus_dozen_wide$h_lines_y)
#> [1] 0.9936815