R/where.na.R

where.na <-
function (x) 
{
    if (is.data.frame(x)) 
        x <- as.matrix(x)
    whichna <- seq(along = x)[is.na(x)]
    if (length(whichna) == 0) {
        cat("  No NAs\n")
    }
    else {
        if (is.vector(x)) 
            cat("  Postion(s):", whichna, "\n")
        else {
            rows <- unique(sort(whichna%%dim(x)[[1]]))
            cat("  Row(s):", rows, "\n")
        }
    }
    invisible(whichna)
}

Try the rgr package in your browser

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

rgr documentation built on May 2, 2019, 6:09 a.m.