I want to split
a data frame, with an arbitrary number of columns, by the last column, without providing a column name or number. Something like [imaginary code land]:
d <- split(MY_DATA, ncol(MYDATA))
A sample data set might be something like:
pepsi 1
dr_pep 2
coke 1
Where our data set has no headers, by the last column would represent a desired grouping like the following:
dr_pep 2 --> group 2
pepsi 1 --> group 1
coke 1