R/whichAeqB.R

Defines functions whichAeqB

Documented in whichAeqB

whichAeqB <- function(A, B, errNoMatch='no match',
                      err2Match='more than one match'){
    ab <- which(A %in% B)
    nab <- length(ab)
    if(nab<1){
        stop(errNoMatch)
    }
    if(nab>1){
        stop(err2Match)
    }
    ab
}

Try the Ecfun package in your browser

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

Ecfun documentation built on Oct. 10, 2022, 1:06 a.m.