title: R: How to replace only particular strings in a dataframe column
body: <p>I have a dataframe column which has values like Americ0,Indi0,Data 2.0...
  While doing the data cleaning I am supposed to replace "0" with "an"  </p>
  
  <pre><code>df$column &lt;- lapply(df$column, function(x){
    str_replace(x,"0","an")
  
  })
  </code></pre>
  
  <p>I am using the above code to replace <em>0</em> with "an" which is working as expected. The problem now is there are certain values in df$column which are not to be replaced like the value <em>Data 2.0</em> .Appreciate if someone can help me on this.</p>