Inverting scales

inv(x, min, max)

Arguments

x

A vector of numeric data.

min

The minimum value of the scale.

max

The maximum value of the scale.

Examples

# Assuming you have a Likert-scale from 1 to 9 x <- c(4, 5, 2, 3, 7, 8, 3) inv(x, 1, 9)
#> [1] 6 5 8 7 3 2 7