str_replace should ignore NA when using function as replacement by yutannihilation · Pull Request #164 · tidyverse/stringr

I like str_replace() with function replacement. It's a very cool feature. One thing, currently, the code bellow returns a vector contains NA: text <- c("A1", "B1", "CC") pattern <- "[A-Z][0-9]" st...