sq_matrix: Takes a vector and converts it into a square matrix

Description Usage Arguments Value See Also Examples

View source: R/utilities.R

Description

sq_matrix takes a vector and converts it into a square matrix.

Usage

1
  sq_matrix(data, byrow = TRUE)

Arguments

data

Object (probably vector) to be turned into square matrix

byrow

Whether to fill in the matrix by row or by column

Value

A matrix with the same number of columns and rows

See Also

link{matrix}

Examples

1
2
3
sq_matrix(1:4)
sq_matrix(1:4, FALSE)
matrix(1:4, nrow=2)

tldutils documentation built on May 31, 2017, 4:35 a.m.

Search within the tldutils package
Search all R packages, documentation and source code