[R] Create design matrix
Stephen.Bond at cibc.com
Thu Nov 3 18:56:06 CET 2011
What is the easiest way to create a design matrix of several factor variables? Function gendata in Design seems to do that for a fitted model, but how to do that only on several factor vectors??
The result should be a df with one row for each distinct combination of levels of factors eg for (M,F) (Y,O)
In reality I will have more than 1000 rows so doing by hand not good.
Maybe there is a way with "outer", but I couldn't see it.
All the best to everybody.
More information about the R-help