R/isRepetitive.R

`isRepetitive` <- function(x) {
    n <- length(x)
    retval <- FALSE
    if (is.list(x)) {
        if (n>2) 
            for (i in 1:(n-1)){
                if (setequal(x[[n]], x[[i]]))
                    return(TRUE)
            }
    } else {
        n <- length(x)
        if (n>2) 
            for (i in 1:(n-1)){
                if (x[n] == x[i])
                    return(TRUE)
            }
    }
    FALSE 
}

Try the betr package in your browser

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

betr documentation built on April 14, 2017, 5:16 a.m.