?expand.grid is what you're looking for, I think.
(which, I agree, is not something one could easily guess)
-- Bert
On Thu, Nov 3, 2011 at 10:56 AM, Bond, Stephen wrote:
> Greetings useRs,
>
> What is the easiest way to create a design matrix of several factor
> variables? Function gendata in
?expand.grid
> expand.grid(c("M","F"),c("Y","O"))
Var1 Var2
1MY
2FY
3MO
4FO
>
Justin
On Thu, Nov 3, 2011 at 10:56 AM, Bond, Stephen wrote:
> Greetings useRs,
>
> What is the easiest way to create a design matrix of several factor
> variables? Function gendata
2 matches
Mail list logo