Nested ifelse statement

前端 未结 9 1376
逝去的感伤
逝去的感伤 2020-11-22 04:02

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

9条回答
  •  一个人的身影
    2020-11-22 04:38

    You can create the vector idnat2 without if and ifelse.

    The function replace can be used to replace all occurrences of "colony" with "overseas":

    idnat2 <- replace(idbp, idbp == "colony", "overseas")
    

提交回复
热议问题