When it comes to accessing the elements in a list or dataframe, the difference between bracket [] and double bracket [[]] is significant (11 answers)
1 year ago, this business was closed.
I'm having trouble dividing a string using strsplit in R to create two independent strings. I realise this is probably a basic request, but I'm having trouble finding an answer.
I have an x string that looks like this:
"1.23e+05,1.3e+05"
I attempted to separate it using the following code:
str split - strsplit(x,split=',', fixed=TRUE) appears to create a list of length 1 with the following characters: "1.23e+05" "1.3e+05"
However, when I use str split[1] to subset this, it just returns the entire thing.
What is the simplest way to extract two substrings from this data?