Learn R Programming

SciencesPo (version 0.11.21)

lsq: Latin Square

Description

A Latin square is a matrix of n*n elements. That is, it consists in a matrix of n columns and n rows arranged in a way to avoid orthogonality (a row or a column will not contain the same number twice).

Usage

lsq(size, rep = 1, seed = NA, id = FALSE)

Arguments

size
An integer value for the size of the design.
rep
An integer value for repetition design.
seed
A value to generate a random distribution. The argument seed is useful for it assures the same distribution in case replication is needed.
id
A logical value indicating whether an ID should be attributed for each element of the matrix.

Value

  • A Latin square object with class matrix.

encoding

UTF-8

References

Tarry, G. (1900) Le probleme de 36 officiers. Compte Rendu de l'Assoc. Francais Avanc. Sci. Naturel, 1, 122--123.

Tarry, G. (1901) Le probleme de 36 officiers. Compte Rendu de l'Assoc. Francais Avanc. Sci. Naturel, 2, 170--203.

Examples

Run this code
lsq(4, 2, seed = 51)

Run the code above in your browser using DataLab