vec_expand_grid(x = 1:2, y = 1:3)
# Use `.vary` to match `expand.grid()`:
vec_expand_grid(x = 1:2, y = 1:3, .vary = "fastest")
# Can also expand data frames
vec_expand_grid(
x = data_frame(a = 1:2, b = 3:4),
y = 1:4
)
Run the code above in your browser using DataLab