Learn R Programming

iRoCoDe (version 1.0.1)

rearrange_mat: Rearranges the given matrix

Description

The rearrange_mat function rearranges the column elements of a given 'a_matrix'.

Usage

rearrange_mat(a_matrix, treatments)

Arguments

a_matrix

A a_matrix of the first design (D1)

treatments

The number of treatments of the second design (D2)

Value

It returns new 'a_matrix' (A) with each row containing all the treatments of D2 exaclty once.

Details

This function reads an 'a_matrix' (A) generated from two designs (D1 and D2) and rearranges the column elements based on the treatments numbers in the second design (D2). It iteratively rearrange the items row-wise until the new A is generated with each row containing all the treatments of D2 exaclty once.