Does anyone know how to split a string in R based on punctuation or how can I remove everything before punctuation, but not the punctuation?
x <- c("a>1", "b2<0", "yy01>10")
The following is the desired result:
"a", "b2", "yy01"
">1", "<0", ">10"
To get the first part I can do:
gsub("\\b\\d+\\b|[[:punct:]]", "", x)
"a" "b2" "yy01"
But I am not sure how to get the second one. Does anyone have an idea?
Thanks