# NOT RUN {
# Simple example of expand.grid vs. expand_grid
expand.grid(x = c("a", "b", "c"), y = c(1, 2), z = c(TRUE, FALSE))
expand_grid(x = c("a", "b", "c"), y = c(1, 2), z = c(TRUE, FALSE))
# How to keep certain variables together
expand_grid(x = 1: 5,
together = data.frame(y = c("1a", "2a"), z = c("1b", "2b")))
# }
Run the code above in your browser using DataLab