So basically I would like to randomly sort ~200 unique ID "numbers" (strings consisting of a letter and a number e.g. x1, x2, y40, ... ) into multiple groups of 5 without replication and with some ID "numbers" not being assigned a group.
For a minimal working example I've created 32 uniquie ID "numbers" which I would like to sort into 7 groups of 3, "using" up 21 unique ID "numbers" with 11 unique ID "numbers" being left over.
# creating 32 unique IDs
ID = c("y6","x1","x3", "x4", "x5","x12","x7", "x8", "x9","z6", "x10",
"y1","x11","z3","y2","y3", "y4", "y5", "y7", "y8", "y9", "y10",
"x13","z1","x6","z2", "z4", "z5", "z7", "z8", "z9","x2")
# and this would be how I create the first group of 3 unique ID "numbers"
sample(ID, 3, replace = FALSE, prob = NULL)
# OUTPUT [1] "x3" "x6" "y8"
So far so good, but is there a way to do this without having then to erase the chosen numbers of that group from ID and then having to select the next group of 3 and so on until I have 7 groups of 3? As this might be doable for small datasets, but not for large ones.
PS: Yes I've searched, but didn't find anything that applied and I'm a bit of an R newby and am stuck. :(
I'd really appreciate any help!