Calculate the top pair of variables or group for each scagnostic

top_scags(scags_data)

Arguments

scags_data

A dataset of scagnostic values that was returned by calc_scags or calc_scags_wide

Value

A data frame where each row is a scagnostic with its highest pair and the associated value

See also

calc_scags calc_scags_wide top_pairs

Examples

#an example using calc_scags
require(dplyr)
datasaurus_dozen %>%
  group_by(dataset) %>%
  summarise(calc_scags(x,y, scags=c("monotonic", "outlying", "convex"))) %>%
  top_scags()
#> # A tibble: 3 × 3
#>   dataset scag      value
#>   <chr>   <chr>     <dbl>
#> 1 h_lines convex    0.953
#> 2 dots    monotonic 0.126
#> 3 circle  outlying  0.153
 #an example using calc_scags_wide
 data(pk)
 scags_data <- calc_scags_wide(pk[,2:5], scags=c("outlying","clumpy","monotonic"))
 top_scags(scags_data)
#> # A tibble: 3 × 4
#>   Var1           Var2         scag      value
#>   <fct>          <fct>        <chr>     <dbl>
#> 1 MDVP:Flo(Hz)   MDVP:Fhi(Hz) clumpy    0.971
#> 2 MDVP:Fhi(Hz)   MDVP:Fo(Hz)  monotonic 0.796
#> 3 MDVP:Jitter(%) MDVP:Fhi(Hz) outlying  0.541