How can I selectively rewrite an old vector? I want to add replacement values, but only where they are not = NA.
So, starting with this data:
old.vector <- 1:5
replacement.values <- c('x', 'y', NA, 'z', NA)
I want to finish this vector: new.vector: c('x', 'y', 3, 'z', 5)
edit: Thanks for the welcome and help. It's great to see a bunch of different ways to do the same.
source
share