calc_scags: Compute selected scagnostics on subsets

View source: R/calculate.R

calc_scagsR Documentation

Compute selected scagnostics on subsets

Description

Compute selected scagnostics on subsets

Usage

calc_scags(
  x,
  y,
  scags = c("outlying", "stringy", "striated", "striated2", "clumpy", "clumpy2",
    "sparse", "skewed", "convex", "skinny", "monotonic", "splines", "dcor"),
  out.rm = TRUE,
  euclid = FALSE
)

Arguments

x

numeric vector

y

numeric vector

scags

collection of strings matching names of scagnostics to calculate: outlying, stringy, striated, striated2, striped, clumpy, clumpy2, sparse, skewed, convex, skinny, monotonic, splines, dcor

out.rm

logical indicator to indicate if outliers should be removed before calculating non outlying measures

euclid

logical indicator to use Euclidean distance

Value

A data frame that gives the single plot's scagnostic score.

See Also

calc_scags_wide

Examples

# Calculate selected scagnostics on a single pair
calc_scags(anscombe$x1, anscombe$y1, scags=c("monotonic", "outlying"))

# Compute on long form data, or subsets
# defined by a categorical variable
require(dplyr)
datasaurus_dozen %>%
  group_by(dataset) %>%
  summarise(calc_scags(x,y, scags=c("monotonic", "outlying", "convex")))


cassowaryr documentation built on Aug. 9, 2022, 5:08 p.m.