R/linearity.R

Defines functions linearity

Documented in linearity

linearity <- function(input, representation = c("H", "V")) {

    representation <- match.arg(representation)
    fred <- attr(input, "representation")
    if (! is.null(fred))
        representation <- match.arg(fred, c("H", "V"))
    h <- representation == "H"

    validcdd(input, representation)

    if (is.character(input)) {
        out <- .Call(C_impliedLinearity, input, h)
    } else {
        if (! is.numeric(input))
            stop("input must be numeric or character")
        storage.mode(input) <- "double"
        out <- .Call(C_impliedLinearity_f, input, h)
    }

    return(out)
}

Try the rcdd package in your browser

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

rcdd documentation built on May 29, 2024, 2:21 a.m.