An expand.grid-like function that repeats sets of vectors for every value in a reference vector.
expand.grid
Useful links