Learn R Programming

tiger (version 0.2.3.1)

count.diff.direction.error: Compare sign of derivatives

Description

Counts the number of elements for which two vectors show different signs in the derivative.

Usage

count.diff.direction.error(x, y)

Arguments

x
First vector
y
Second vector

Value

sum((diff(x) / diff(y))<0, na.rm="T)

See Also

diagnostic_dawson

Examples

Run this code
#All different
count.diff.direction.error(1:10,10:1)

#One different
count.diff.direction.error(1:10,c(1:9, 8))

Run the code above in your browser using DataLab