in my dataset I got a column containing conflict intensity with a rating (1, 2) - now I would like to change this to a Y/N dummie (so instead of intensity rating I want to know if there was a conflict or not in given country in given year) - meaning if there is a NA it should become a 0 if there is any number it should become a 1. The pictures should display it easier :)
I am working with R since 3 days :D so I am very new - I figured out to replicate and rename the column - no I just need to rewrite the content of it, I think the if(){} code might be helpful here - but I dont know what needs to come first in the coding of the function - so I d appreciate help a lot !! thanks :)
this is the original column
and this is the column replicated & renamed - where only the rewriting of the numbers is missing - the red ones are the desired outcome :)