expand.grid(...)
#creating factor objectsa <- c( 1, 2, 3)b <- c( 4, 5, 6)c <- c( 7, 8, 9)# implementing the expand.grid() functionexpand.grid(a, b, c)
a
, b
and c
.expand.grid()
function and pass the factor objects as its arguments. We obtain and print the result to the console.