R/diag2.R

Defines functions diag2

## File Name: diag2.R
## File Version: 0.04

diag2 <- function( vec)
{
    if ( length(vec) > 1){
        res <- diag(vec)
    } else {
        res <- matrix(vec, nrow=1,ncol=1)
    }
    return(res)
}

Try the sirt package in your browser

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

sirt documentation built on May 29, 2024, 8:43 a.m.