Use the splitstackshape R package to stack and reshape datasets after splitting concatenated values
Online data collection tools like Google Forms often export multiple-response questions with data concatenated in cells. The concat.split
(cSplit
) family of functions splits such data into separate cells. The package also includes functions to stack groups of columns and to reshape wide data, even when the data are "unbalanced"---something which reshape
(from base R) does not handle,
and which melt
and dcast
from reshape2 do not easily handle.
The package has data.table as a dependency and some of its functions return data.tables.