0

I am replacing " o " with new line character, a carriage return and two tabs and the o. It works except I'm only getting one tab, why? How can I specify two tabs since \t\t does not work.

data.frame(lapply(dfClean[,selectCols], gsub, pattern = " o ", replacement = "\r\n\t\to ", perl = TRUE))
user3482393
  • 327
  • 4
  • 14
  • 1
    I can't replicate this. I have two tabs as expected. Could you share a sample input string and its output string please? – Allan Cameron Jan 12 '23 at 15:14
  • It's easier to help you if you include a simple [reproducible example](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) with sample input and desired output that can be used to test and verify possible solutions. – MrFlick Jan 12 '23 at 15:15

0 Answers0