Does anyone has an idea how to achieve the following: start from here
df <- data.frame(var = c(0,0,1,1,0,0,0,1,1,0,0,0,0,1,1))
and achieve this:
df <- data.frame(var = c(0,0,1,1,0,0,0,1,1,0,0,0,0,1,1),
newvar = c(0,0,1,1,0,0,0,2,2,0,0,0,0,3,3))
newvarwith every1and not0