Compute convex scagnostic measure

sc_convex(x, y)

# S3 method for default
sc_convex(x, y)

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

# S3 method for list
sc_convex(x, y)

Arguments

x

numeric vector of x values

y

numeric vector of y values

Value

A "numeric" object that gives the plot's convex score.

Examples

  require(ggplot2)
  require(dplyr)
  ggplot(features, aes(x=x, y=y)) +
     geom_point() +
     facet_wrap(~feature, ncol = 5, scales = "free")

  features %>% group_by(feature) %>% summarise(convex = sc_convex(x,y))
#> # A tibble: 15 × 2
#>    feature    convex
#>    <chr>       <dbl>
#>  1 barrier    0.818 
#>  2 clusters   0.522 
#>  3 discrete   0.944 
#>  4 disk       0.921 
#>  5 gaps       0.817 
#>  6 l-shape    0.0710
#>  7 line       0.312 
#>  8 nonlinear1 0.748 
#>  9 nonlinear2 0.218 
#> 10 outliers   0.427 
#> 11 outliers2  0.117 
#> 12 positive   0.665 
#> 13 ring       0.304 
#> 14 vlines     0.964 
#> 15 weak       0.894 
  sc_convex(datasaurus_dozen_wide$away_x, datasaurus_dozen_wide$away_y)
#> [1] 0.7322547