numDiffs2: Differences in Numeric Variables

Description Usage Arguments Value Examples

View source: R/similarity-scores.R

Description

Computes the scaled difference between a vector of numeric variables and a matrix of numeric variables. Should not usually be called by hand. Instead, use the calcScores2 function.

Usage

1
numDiffs2(vec, dat)

Arguments

vec

a numeric vector. Each value in the vector corresponds to a unique variable.

dat

a numeric matrix or data.frame of numeric variables. The number of columns must be equal to the length of vec.

Value

a matrix of the same dimensions as dat. The ith entry in the jth row corresponds to the absolute value of the difference between the jth value of vec and the jth value of the ith row of dat.If either the ith value of the jth row of dat or the jth value of vec are missing, and NA will be returned.

Examples

1
2
3
example_vec <- c(1,2, NA)
example_dat <- iris[1:6, 1:3]
numDiffs2(example_vec, example_dat)

guytuori/simScores documentation built on May 17, 2019, 9:29 a.m.