Since the coding we have often uses negative numbers to indicate left-hand preferences, a specialized function is here to return a vector with only the values asked for.

ehi_change(x, direction = 1)

Arguments

x

numeric vector

direction

either 1 for positive, -1 for negative

Value

numeric vector

Details

If direction is set to 1, returns only positive numbers, negative and 0 returns as NA. If direction is set to -1, returns only negative numbers, positive and 0 returns as NA.