I have created a function in R to convert compass points to the corresponding wind direction. Function is below.
if(x == 1) y <- "North" if(x