Learn R Programming

fBasics (version 4021.93)

colVec: Column and row vectors

Description

Creates a column or row vector from a numeric vector.

Usage

colVec(x)
rowVec(x)

Arguments

x

a numeric vector.

Details

The functions colVec and rowVec transform a vector into a column and row vector, respectively. A column vector is a matrix object with one column, and a row vector is a matrix object with one row.

Examples

Run this code
## Create a numeric Vector:
   x = rnorm(5)
   
## Column and Row Vectors:
   colVec(x)
   rowVec(x)                        

Run the code above in your browser using DataLab