R/vec.R

Defines functions vec

Documented in vec

vec <- function( x )
{
###
### this function returns a column vector that is a stack of the columns of x
###
### Parameters
### x = a numeric matrix
###
    if ( !is.matrix( x ) ) {
        stop( "argument x is not a matrix" )
    }
    if ( !is.numeric( x ) ) {
        stop( "argument x is not a numeric matrix" )
    }    
    return( t( t( as.vector( x ) ) ) )
}

Try the matrixcalc package in your browser

Any scripts or data that you put into this service are public.

matrixcalc documentation built on Sept. 15, 2022, 1:05 a.m.