title: dplyr mutate replace value(s) in a single column based on condition(s) in an efficient way
body: <p>I would like to replace the values <code>c t</code>, <code>o p</code> of the column <code>b</code> with <code>c_t</code>, <code>o_p</code> respectively. I have achieved the task using the following approaches. </p>
  
  <pre><code>d &lt;- data.frame(a = c(5,6,3,7,4,3,8,3,2,7), 
                  b = c('c t','c_t','d','o p','o_p','c m','c_t','d','o t','o_p'))
  # Way-1
  d %&gt;% 
      mutate(b = replace(b, b == 'c t', 'c_t')) %&gt;% 
      mutate(b = replace(b, b == 'o p', 'o_p'))
  
  # Way-2
  d %&gt;% mutate(b = replace(b, b == 'c t', 'c_t'), 
               b = replace(b, b == 'o p', 'o_p'))
  </code></pre>
  
  <p>Output:</p>
  
  <pre><code>#    a   b
  # 1  5 c_t
  # 2  6 c_t
  # 3  3   d
  # 4  7 o_p
  # 5  4 o_p
  # 6  3 c m
  # 7  8 c_t
  # 8  3   d
  # 9  2 o t
  # 10 7 o_p
  </code></pre>
  
  <p>However, I would like to know if there are any other efficient approaches to achieve this? I would only need to do this for selected values but not all values having space.</p>