
Test whether an object contains numeric values from the interval \([0,1]\)
Source:R/is_degree.R
is_degree.Rd
Check if the input consists only of numeric values between 0 and 1, inclusive. This is often useful when validating truth degrees, membership values in fuzzy sets, or probabilities.
Value
A logical scalar. Returns TRUE
if all (non-NA
) elements of x
are numeric and lie within the closed interval \([0,1]\). Returns
FALSE
if:
x
contains anyNA
values andna_rm = FALSE
any element is outside the interval \([0,1]\)
x
is not numericx
is empty (length(x) == 0
)