split character columns and get names of field in string
问题 I need to split a column that contains information into several columns. I'd use tstrsplit but the same kind of information is not in the same order among the rows and I need to extract the name of the new column within the variable. Important to know: there can be many pieces of information (fields to become new variables) and I don't know all of them, so I don't want a "field by field" solution. Below is an example of what I have: library(data.table) myDT <- structure(list(chr = c("chr1",