Skip to content
Prev 12572 / 398502 Next

replacing values in a vector

You should assign the result of replace back to n:

n <- replace(n, which(is.na(v)), NA)

Giovanni