title: str_replace in a data frame?
body: <p>In my R code I'm trying to insert a line break into a few longer string values of one of the columns in my data set. The code runs, but the output is always identical to the original string with no changes occurring. When I pull the column out as a vector and apply the same code, it works completely fine. I'm still new to R and the process of removing a column to apply a function and then re-attaching it to the original data frame seems rather complicated. Is there a successful way I can do this just within the data frame?</p>
  
  <pre><code>library(tidyverse)
  library(stringr)
  
  dog_descriptions2 &lt;-
    dog_descriptions %&gt;% 
    mutate(breed_primary2 = str_replace_all(breed_primary, c("Pit Bull Terrier" = "Pit Bull\nTerrier", "Labrador Retriever" = "Labrador\nRetriever", "Border Collie" = "Border\nCollie")))
  </code></pre>
  
  <p>Thanks for your help!</p>