I\'m still learning how to translate a SAS code into R and I get warnings. I need to understand where I\'m making mistakes. What I want to do is create a variable which summ
You can create the vector idnat2 without if and ifelse.
idnat2
if
ifelse
The function replace can be used to replace all occurrences of "colony" with "overseas":
replace
"colony"
"overseas"
idnat2 <- replace(idbp, idbp == "colony", "overseas")