as.mRowVector {implicitExpansion}R Documentation

Row and Column Vectors

Description

These functions coerce an object to a 2-dimensional array in the shape of a row or column vector, i.e. an array with dimensions c(1,d) or c(d,1) respectively, where d=length(x).

Usage

as.mRowVector(x, USE.NAMES = TRUE)

as.mColVector(x, USE.NAMES = TRUE)

Arguments

x

An object that can be passed to array().

USE.NAMES

If TRUE and x has only one non-singular dimension, its names are preserved.

Value

A row or column vector with the data from x.

Examples

x <- c(a=1, b=2, c=3)
as.mColVector(x)

y <- matrix(1:12, 3, 4)
as.mRowVector(y)


[Package implicitExpansion version 0.1.0 Index]