case 1: a process is returning the variable "a"
a <- c(0.25,0.9) b <- as.factor(ifelse(a> 0.5, 1, -1)) #if the value of "