invert_variable: Invert a variable

Description Usage Arguments Details Value

View source: R/transform_variables.R

Description

invert_variable returns the variable with an inverted scale. The heighest possible value for a variable can be provided. If min_value or max_value is not provided, the respective value is computed from x.

Usage

1
invert_variable(x, min_value = NULL, max_value = NULL)

Arguments

x

A numeric variable.

min_value

Optional, the lowest possible value on the variable's scale.

max_value

Optional, the heighest possible value on the variable's scale.

Details

For a variable with values between 1 and 5, 1 will become 5, 2 will become 4, 1 will become 5, and so on.

Value

The same variable with an inverted scale.


jogrue/jogRu documentation built on Nov. 10, 2019, 9:13 a.m.