Compute selected scagnostics on subsets

calc_scags(
  x,
  y,
  scags = c("outlying", "stringy", "striated", "clumpy", "sparse", "skewed", "convex",
    "skinny", "monotonic", "splines", "dcor")
)

See also

sc_pairwise

Examples

# Calculate selected scagnostics on a single pair
calc_scags(anscombe$x1, anscombe$y1,
  scags=c("monotonic", "outlying","convex"))
#> Registered S3 method overwritten by 'cli':
#>   method     from         
#>   print.boxx spatstat.geom
#> # A tibble: 1 × 3
#>   outlying convex monotonic
#>      <dbl>  <dbl>     <dbl>
#> 1        0  0.736     0.818

# Calculate all large number of scagnostics together
calc_scags(anscombe$x1, anscombe$y1)
#> # A tibble: 1 × 9
#>   outlying stringy striated clumpy sparse skewed monotonic splines  dcor
#>      <dbl>   <dbl>    <dbl>  <dbl>  <dbl>  <dbl>     <dbl>   <dbl> <dbl>
#> 1        0   0.714        0  0.407  0.271  0.270     0.818   0.667 0.667

# Compute on long form data, or subsets
# defined by a categorical variable
require(dplyr)
#> Loading required package: dplyr
#> 
#> Attaching package: ‘dplyr’
#> The following objects are masked from ‘package:stats’:
#> 
#>     filter, lag
#> The following objects are masked from ‘package:base’:
#> 
#>     intersect, setdiff, setequal, union
datasaurus_dozen %>%
  group_by(dataset) %>%
  summarise(calc_scags(x,y,
    scags=c("monotonic", "outlying", "convex")))
#> # A tibble: 13 × 4
#>    dataset    outlying   convex monotonic
#>    <chr>         <dbl>    <dbl>     <dbl>
#>  1 away         0.0535 0.795      0.0573 
#>  2 bullseye     0.113  0.884      0.0787 
#>  3 circle       0.273  0.000574   0.0773 
#>  4 dino         0      0.895      0.0651 
#>  5 dots         0.330  0.000465   0.126  
#>  6 h_lines      0.177  0.923      0.0520 
#>  7 high_lines   0.0726 0.359      0.00287
#>  8 slant_down   0.0444 0.921      0.0669 
#>  9 slant_up     0.0427 0.914      0.0861 
#> 10 star         0.404  0.535      0.0514 
#> 11 v_lines      0.190  0.935      0.0566 
#> 12 wide_lines   0.0180 0.311      0.0522 
#> 13 x_shape      0.186  0.159      0.0205