Splitting a variable at arbitrary values into subsets