Learn R Programming

usefun (version 0.5.2)

get_ternary_class_id: Get ternary class id

Description

Helper function that checks if a value surpasses the given threshold either positively, negatively or not at all and returns a value indicating in which class (i.e. interval) it belongs.

Usage

get_ternary_class_id(value, threshold)

Value

an integer. There are 3 cases:

  • \(1\): when \(value > threshold\)

  • \(-1\): when \(value < -threshold\)

  • \(0\): otherwise

Arguments

value

numeric

threshold

numeric