Constructs single vector by prioritising certain codes, depending on a given hierarchy regime

regime(var1 = NULL, var2 = NULL, var3 = NULL, var4 = NULL,
  regime = NULL)

Arguments

var1

First variable to be used, required

var2

Second variable to be used, required

var3

Third variable to be used, not required

var4

Fourth variable to be used, not required

Value

A vector the same length as var1

Examples

# NOT RUN {
myData$J <- regime(myData$J, myData$J1, myData$J2, regime = c("G","R","Z","O"))
# }