Como criar uma matriz de design em r

Eu tenho dois fatores. o fator A tem 2 níveis, o fator B tem 3 níveis.

Como criar a matriz de design a seguir?

     factorA1 factorA2 factorB1 factorB2 factorB3
[1,]        1        0        1        0        0
[2,]        1        0        0        1        0
[3,]        1        0        0        0        1
[4,]        0        1        1        0        0
[5,]        0        1        0        1        0
[6,]        0        1        0        0        1

questionAnswers(4)

yourAnswerToTheQuestion