R/is_na_matrix.R

is_na_matrix <-
function (mat, rows = TRUE)
{
    if (!is.matrix(mat))
        stop("'mat' must be a matrix or data frame.")
    if (rows)
        return(apply(mat, 1, function(x) any(is.na(x))))
    else return(apply(mat, 2, function(x) any(is.na(x))))
}

Try the EnvStats package in your browser

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

EnvStats documentation built on Sept. 11, 2024, 6:03 p.m.