R/delete.na.R

Defines functions delete.na

Documented in delete.na

delete.na <-
function (x, alternative = c("less", "greater") )
{
if (alternative == "less")
{

    if (nrow(x) < ncol(x))
        a <- na.omit(x)
    else {
        a <- t(x)
        b <- na.omit(a)
        a <- t(b)
    }
    b <- cbind(a)
    return(b)
}
if (alternative == "greater")
{

    if (nrow(x) > ncol(x))
        a <- na.omit(x)
    else {
        a <- t(x)
        b <- na.omit(a)
        a <- t(b)
    }
    b <- cbind(a)
    return(b)
}
}

Try the agricolae package in your browser

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

agricolae documentation built on Sept. 13, 2017, 1:03 a.m.