0

I have a data frame like below

Des              NewColumn
a                27.82 / 23.65 / 27.82
c                32.25 / 31 / 32.25 / 31

I need / to be replaced by > and below is what i need

Des              NewColumn
a                27.82 > 23.65 > 27.82
c                32.25 > 31 > 32.25 > 31
camille
  • 16,432
  • 18
  • 38
  • 60

2 Answers2

1

We can use gsub

gsub("[/]", ">", df1$NewColumn)

or use chartr

chartr("/", ">", df1$NewColumn)
akrun
  • 874,273
  • 37
  • 540
  • 662
0

We can use stringr library:

 library(stringr)
 str_replace_all(df$NewColumn,"/",">")
Saurabh Chauhan
  • 3,161
  • 2
  • 19
  • 46