splitstackshape
splitstackshape copied to clipboard
throw error when the separator is ''
The concatenated column, 'response', in my data.table,'dt.gdoc' contains number string with no separator, e.g. "13464". I wanted to split this column into a list using
cSplit_l(dt.gdoc,'response',sep='',drop=T)
However, when I attempted to run this code, I got the following error:
Error in gsub(sprintf("\s+[%s]\s+|\s+[%s]|[%s]\s+", delim, delim, :
invalid regular expression '\s+[]\s+|\s+[]|[]\s+', reason 'Missing ']''
@lilchow, Thanks. I'll look into it. I'll probably need to add a stripWhite = FALSE
argument like there is for cSplit
.