ks_distance: Kolmogorov-Smirnov distance

View source: R/ks_distance.R

ks_distanceR Documentation

Kolmogorov-Smirnov distance

Description

Kolmogorov-Smirnov distance

Usage

ks_distance(data, ...)

## S3 method for class 'data.frame'
ks_distance(data, truth, estimate, na_rm = TRUE, case_weights = NULL, ...)

ks_distance_vec(truth, estimate, na_rm = TRUE, case_weights = NULL, ...)

Arguments

data

A data.frame containing the columns specified by the truth and estimate arguments.

...

Not currently used.

truth

The column identifier for the true results (that is numeric). This should be an unquoted column name although this argument is passed by expression and supports quasiquotation (you can unquote column names). For ⁠_vec()⁠ functions, a numeric vector.

estimate

The column identifier for the predicted results (that is also numeric). As with truth this can be specified different ways but the primary method is to use an unquoted variable name. For ⁠_vec()⁠ functions, a numeric vector.

na_rm

A logical value indicating whether NA values should be stripped before the computation proceeds.

case_weights

This is a placeholder for now and will be added when case_weights are added to tidysynthesis.

Value

For ks_distance_vec(), a single numeric value (or NA).

A single numeric value (or NA).

A single numeric value (or NA).

Examples


ks1 <- data.frame(x = 1:100, y = 101:200)

ks_distance(data = ks1, truth = x, estimate = y)


ks1 <- data.frame(x = 1:100, y = 101:200)

ks_distance(data = ks1, truth = x, estimate = y)


ks1 <- data.frame(x = 1:100, y = 101:200)

ks_distance_vec(truth = ks1$x, estimate = ks1$y)


tidysynthesis documentation built on March 17, 2026, 1:06 a.m.