I would like to replace all occurrences of ""
in a vector with <NA>
. Suppose,
V<- c("","Axe","Saw","")
Then after replacement,
V<- c("<NA>","Axe","Saw","<NA>")
Using gsub
to replace a substring is easy but for searching ""
I think I need to use /
or \
inside ""
but not sure how do do it.