The n_matrix functions creates an incidence matrix/'n_matrix' (N) from a given design.
n_matrix(design, treatments, blocks)A design in matrix format
Number of treatments in the given design
Number of blocks in the given design
It returns a matrix (N) with the dimension of (v1 x b1)
This functions reads a design (D1) in matrix format, its no. of treatments (v1) and its no. of blocks (b1) as input. Here the rows of design D1 are treated as blocks. The generated incidence matrix (N) will have the dimension of (v1 x b1).