This function is the same as sum(), with one exception: If the outcome value is higher than 1, it will always return 1.

sum_0_1(x)

Arguments

x

a vector with numeric values

Value

0 or 1. Depending on whether the sum is greater than 0 or not.

See also