I am doing some class exercises in R, this particular exercise we have to organize a dataset to apply a basket analysis, but i think i\'m doing a hard way, so my question is