R/intersectAll.r

Defines functions intersectAll

##
## INPUT:
## ...: vectors of any standard class
##
## RETURN:
## vector of elements contained in all vectors in '...'
##
intersectAll <- function(...)
{
    x <- list(...)
    ans <- x[[1]]
    for (i in 1:length(x)) ans <- intersect(ans, x[[i]])

    return(ans)
}

Try the games package in your browser

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

games documentation built on May 2, 2019, 3:26 p.m.