R/delete.na.R

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 Oct. 23, 2023, 1:06 a.m.