val_in_interval {YEAB} | R Documentation |
True value in interval
Description
True value in interval
Usage
val_in_interval(df, lowLim, upLim, true.val)
Arguments
df |
A data frame containing the intervals to be evaluated. Each row should correspond to an interval with lower and upper limits. |
lowLim |
the column index or name in the data frame |
upLim |
the column index or name in the data frame |
true.val |
the true value to be checked if it falls within
the interval defined by |
Value
A numeric vector of n elements with an integer value for each interval: 0 if the value is below the interval, 1 if it is inside the interval (with a rightmost open limit), and 2 if it is above the interval.
Examples
# Example data frame with intervals
df <- data.frame(lower = c(1, 5, 10), upper = c(3, 8, 15))
# Check if the value 6 is within any of the intervals
val_in_interval(df, "lower", "upper", 6)
[Package YEAB version 1.0.6 Index]