0

I would like to remove all words starting with the pattern "R-HSA-" in a vector. For instance, given the following vector:

a <- c ("Formation Of ATP By Chemiosmotic Coupling R-HSA-163210", "Cristae Formation R-HSA-8949613" , "Mitochondrial Biogenesis R-HSA-1592230")

I would need it to become this, i.e., removal of the substring starting with "R-HSA-"

> a
[1] "Formation Of ATP By Chemiosmotic Coupling"
[2] "Cristae Formation"                       
[3] "Mitochondrial Biogenesis"

I tried to work staring from this approach, but it didn't work for me: remove a string starting with @ in data frame column in R

Thanks in advance

Arturo
  • 342
  • 1
  • 4
  • 14

0 Answers0