sc_monotonic: Measure of Spearman Correlation

View source: R/association.R

sc_monotonicR Documentation

Measure of Spearman Correlation

Description

Measure of Spearman Correlation

Usage

sc_monotonic(x, y)

Arguments

x

numeric vector

y

numeric vector

Value

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

Examples

  require(ggplot2)
  require(tidyr)
  require(dplyr)
  data(anscombe)
  anscombe_tidy <- anscombe %>%
  pivot_longer(cols = everything(),
    names_to = c(".value", "set"),
    names_pattern = "(.)(.)")
  ggplot(anscombe_tidy, aes(x=x, y=y)) +
    geom_point() +
    facet_wrap(~set, ncol=2, scales = "free")
  sc_monotonic(anscombe$x1, anscombe$y1)
  sc_monotonic(anscombe$x2, anscombe$y2)
  sc_monotonic(anscombe$x3, anscombe$y3)
  sc_monotonic(anscombe$x4, anscombe$y4)


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