I am struggling to get 2 separate strings from splitting a string using strsplit
in R. I appreciate this is probably a very simple request but I can't seem to find an answer.
I have a string called x
which looks like this:
"1.23e+05,1.3e+05"
I tried to split it using this code:
str_split <- strsplit(x,split= ',', fixed=TRUE)
which seem produces a list of length 1, with a character of : "1.23e+05" "1.3e+05"
However when I try and subset this using str_split[1]
it just returns the whole thing.
What is the simplest solution to get 2 substrings from this results?
Thanks