Complement of empty index vector is empty index vector again

后端 未结 3 2076
梦谈多话
梦谈多话 2021-01-26 22:09

I know this question was already posted but the answer was a trick to solve the given problem some other way, but the core question remained unanswered.

The question is

3条回答
  •  南笙
    南笙 (楼主)
    2021-01-26 22:59

    somevector <- c(1:5,NA,8)
    sumvec<-subset(somevector,!is.na(somevector))

    Not too sure if this is what you want, but let me know if you wanted something different so I can correct my answer. The answer hashtagged is an alternative answer if this is what you were looking for.

提交回复
热议问题