Function used to create data frame for compasses.

norm_compass(x, riket_index = length(x))

Arguments

x

Vector, commonly a column in a data frame.

riket_index

Index where 'riket'-row exist.

Value

Normalized vector.

Examples

# Normalize data compass_data[,-1] <- apply(compass_data[,-1], 2, norm_compass) # Make sure that the lowest value is the worst value in every column. # If it is reversed, do like this: compass_data$AE90 <- 1 - compass_data$AE90