Question: what is gl in r?
Answer: R gl. gl() function generates factors by specifying the pattern of their levels. relevel() funtion re-orders levels of a factor so that the level specified by ref is first and the others are moved down. This is useful for contr.