R/z2q.R

Defines functions z2q

Documented in z2q

z2q <- function(numer, denom, canonicalize = TRUE) {
    if (any(denom == 0))
        stop("zero denominator")
    if (length(numer) != length(denom))
        stop("length(numer) != length(denom)")
    ans <- paste(numer, denom, sep = "/")
    mostattributes(ans) <- attributes(numer)
    if (canonicalize)
        ans <- q2q(ans)
    return(ans)
}

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.