ehi_change: Create vector with only correct values

View source: R/ehi-funcs.R

ehi_changeR Documentation

Create vector with only correct values

Description

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.

Usage

ehi_change(x, direction = 1)

Arguments

x

numeric vector

direction

either 1 for positive, -1 for negative

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.

Value

numeric vector


LCBC-UiO/Questionnaires documentation built on July 18, 2023, 6:45 p.m.