I have a list which looks like the following:
list(Element1 = c('ra12345', 'ra13467'),
Element2 = c('ra3467', 'ra5643', 'ra55959'))
I want to run through each element in the list, remove the 'ra' to just leave the integers and then to be able to access each integer individually. I.e. for element 1, I want to be able to access 12345 and 13467 individually, however, I don't know how to do so.
I've tried:
for (I in length(listName)) {
variable <- gsub("rs", "", listName[i])
}
But this returns:
c(\"12345\", \"ra13467\")