I tried to create a new dummy variable for the vote for a far-right party in european countries from vote for such partis at the level of countries (in national elections) with if else. The problem is that, instead of returning 0 for people that don't meet the condition (namely people that voted for another party) it only returned 1 and NAs (so no 0).
This is what I tried (the dataset is that of the 9th wave of the European Social Survey)
ess$rpopuv <- ifelse(ess$prtvede2 == 6 | ess$prtvtcat == 3 | ess$prtvtdbe == 7 | ess$prtvtdbg == 3 | ess$prtvtdbg == 5, 1, 0)
Thanks !