R/which.last.R

which.last = function(x)
{
    if (!is.logical(x)) {
        stop("x not boolean")
    }
    length(x) - match(TRUE, rev(x)) +1
}

Try the data.table package in your browser

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

data.table documentation built on May 2, 2019, 4:57 p.m.