R/makeVector.R

makeVector <- function (x) 
{
    d <- dim(x)
    if (is.null(d)) 
        return(x)
    nn <- NULL
    if (d[1] == 1) {
        nn <- colnames(x)
    }
    else if (d[2] == 1) {
        nn <- rownames(x)
    }
    dim(x) <- NULL
    if (!is.null(nn)) 
        names(x) <- nn
    if ((!is.vector(x)) && (is.list(x))) 
        x <- unlist(x)
    x
}

Try the ARTP2 package in your browser

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

ARTP2 documentation built on May 2, 2019, 3:38 p.m.