I have a line in following format
IP1: IP2: 0.1,0.5,0.9
I split this line using following command:
myVector <- (strsplit(oneLine, ":"))
,where oneline is string "IP1: IP2: 0.1,0.5,0.9"
I want to access the third column and convert it into data frame. I access the third column as below: listofPValues <- myVector[[1]][[3]]
listofPValues <- myVector[[1]][[3]]
I am trying to convert the comma separated values in listofPValues to dataframe as below:
data.frame(as.numeric(listofPValues,',')))
It gives me following error
In data.frame(as.numeric(listofPValues, ",")) :
NAs introduced by coercion
The function that I want to use accepts only data frames. I guess the problem is I need to break the string "0.1,0.5,0.9" before I convert it to numeric. Please let me know if you have any suggestion.
Thanks tictactoe
scanorstrsplitagain. - A5C1D2H2I1M1N2O1R2T1