I have a data set that looks like:
Files Batch
filepath1.txt One
filepath2.txt One
filepath3.txt One
filepath4.txt One
filepath5.txt two
filepath6.txt two
filepath7.txt two
filepath8.txt two
I want to loop over the full data set (that has a dozen “Batch” categories) by creating groups of “Files” that is based on what “Batch” they’re in, in a new variable called “batch”
i.e.
batch[1]
filepath1.txt
filepath2.txt
filepath3.txt
filepath4.txt
batch[2]
filepath5.txt
filepath6.txt
filepath7.txt
filepath8.txt
How do I do this for all my Batch groups in the full data-set?
The
splitfunction seems to be what you’re looking for.