rmsd: Root mean square deviation

View source: R/rmsd.R

rmsdR Documentation

Root mean square deviation

Description

Calculates the euclidean distance between two vectors x and y divided by the square root of the lengths of the vectors. NA values are ignored by default when calculating the mean squares (so the denominator is the number of non-NA differences).

Usage

rmsd(x, y, na.rm = TRUE)

Arguments

x

The first vector to compare (required).

y

The second vector to compare (required). Lengths of x and y must be equal.

na.rm

If TRUE (default), NA values are removed before calculating the mean square difference. If FALSE, any missing values in either x or y result in NA returned. Passed to mean(), see that for more info.

Value

the square root of the mean square difference between x and y, after removing NA comparisons (cases where either is NA).

Examples

x <- rnorm(10)
y <- rnorm(10)
rmsd( x, y )


OchoaLab/simtrait documentation built on April 19, 2024, 7:36 p.m.