title: R: replacing a repeating variable's name in a column
body: <p>I was hoping someone could help me because this problem should be really easy to solve, however it's taking me too much time.</p>
  <p>I have a df (data) with several columns. In one of the columns (<code>rideable_type</code>) I get one of 3 answers, &quot;docked_bike&quot; &quot;classic_bike&quot; &quot;electric_bike&quot;.</p>
  <p>I want to turn every &quot;docked_bike&quot; answer into &quot;classic_bike&quot;.</p>
  <p>When I use</p>
  <pre><code>data$rt&lt;-data$rideable_type %&gt;%
    set_names(~stringr::str_replace_all(.,&quot;docked_bike&quot;, &quot;classic_bike&quot;))
  </code></pre>
  <p>Nothing changes.</p>
  <p>When I use</p>
  <pre><code>data$rt&lt;-data$rideable_type %&gt;% 
    dplyr::rename_all(~stringr::str_replace_all(.,&quot;docked_bike&quot;, &quot;classic_bike&quot;))
  </code></pre>
  <p>I get an error:</p>
  <blockquote>
  <p>Error in UseMethod(&quot;tbl_vars&quot;) :<br />
  no applicable method for 'tbl_vars' applied to an object of class &quot;character&quot;</p>
  </blockquote>
  <p>Thank you for your time</p>