stackByRow: Convert a Vector into a Matrix Filling Across Rows

View source: R/stackByRow.R

stackByRowR Documentation

Convert a Vector into a Matrix Filling Across Rows

Description

This is one of several related convenience functions designed to convert vectors into matrices or matrices into vectors, either by row or by column.

Usage

stackByRow(IN, nrow, ncol)

Arguments

IN

An integer or numeric vector.

nrow

The number of rows in the final matrix.

ncol

The number of columns in the final matrix.

Details

This function is almost the same as matrix, with byrow = TRUE, and there are no dimnames or attributes in this function.

Value

A ncol x nrow matrix with no attributes

See Also

stackByColumn, vectorizeByColumn, vectorizeByRow

Examples

stackByRow(IN = 1:20, nrow = 5, ncol = 4)

bryanhanson/HandyStuff documentation built on July 22, 2022, 6:18 a.m.