search for: mapln

Displaying 1 result from an estimated 1 matches for "mapln".

Did you mean: maple
2009 Sep 08
3
Mapping factors to a new set of factors
...omething). Therefore, I have written a function to perform this mapping. However, the function I have written doesn't seem to work with vectors greater than length 1, and as such is useless. Is there any way to ensure the function would work appropriately for each element of the vector input? mapLN <- function(x) { Reg <- levels(df$Var1) if (x==Reg[1] | x==Reg[2] | x==Reg[13] | x==Reg[17] | x==Reg[20] | x==Reg[23] | x==Reg[27]) {"North"} else if (x==Reg[3] | x==Reg[5] | x==Reg[7] | x==Reg[14] | x==Reg[15] | x==Reg[24] | x==Reg[30]) {"East"} else if (x==Reg[4] | x...