I have a string
mat <- c("[('value-66 > 0.03', 0.1314460), ('0.03 < value-222 <= 0.06', -0.062805), ('0.01 < value-93 <= 0.03', -0.058007), ('value-141 > 0.05', -0.051339234), ('value-108 <= 0.01', -0.0373), ('value-303 > 0.02', 0.037257)]")
I want to divide each parentheses values into three columns.
For the first exemple the final matrix will contain three columns:
value-66, > 0.03, 0.1314460
My difficulty is with example like this one:
'0.01 < value-93 <= 0.03', -0.058007
I have not found a solution to put it into three columns like:
value-93, 0.01 < <= 0.03, -0.058007
I have tried this but it didn't cut correctly
s <- strsplit(mat, ",")
s1 <- lapply(s, function(x) trimws(x,which=c('both')))
s1 <- lapply(s1, function(x) strsplit(x,' '))
Do I have to set conditions in a loop?