R/test_logical.R

Defines functions test_logical

test_logical <- function(name, param, default)
{
    if(missing(param)) {
        if(is.null(default)) {
            p = paste("'",name,"' argument is missing.", sep="");
            stop(p)
        } else 
            return(default);
    } else {
        if(!is.logical(param)) {
            p = paste("'",name,"' argument has to be of type logical.", sep="");
            stop(p);
        }
    }
    return(param);
}

Try the LEA package in your browser

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

LEA documentation built on Nov. 8, 2020, 8:19 p.m.