I have strings such as the following:
2 - 5-< 2
6 - 10-< 2
6 - 10-2 - 5
> 15-2 - 5
I want to split those string just in the point where the - is neither preceded nor followed by blank space. Therefore, the strings above would get split as follows:
"2 - 5" "< 2"
"6 - 10" "< 2"
"6 - 10" "2 - 5"
"> 15" "2 - 5"
In R Studio I have tried using sub() and strsplit() but I have found hard to set the right regex expression. Does anyone has a clue?