Learn R Programming

muStat (version 1.7.0)

sq.array: Produce Square Array or Square Matrix

Description

Convert input data to a square array or a square matrix.

Usage

sq.array(x) sq.matrix(x)

Arguments

x
data object. If x is a vector, length of x should be a square number. Otherwise, the second dimension of x should be a square number.

Value

A square matrix with elements coming from x.

Examples

Run this code
sq.matrix(1:25)
sq.array(matrix(1:50, ,2))

Run the code above in your browser using DataLab