I need to create a dummy which takes the value 1 if the original variable is equal to 3,4,5 and 0 otherwhise. the original variables is an index rescaled from 1 to 7. I already tried this code:
mediumcivlib<-(as.numeric(civlib==3,4,5)
but it gives me back a dummy with 1 corrisponding to three but not to four and five.