View | Details | Raw Unified | Return to bug 16895 | Differences between
and this patch

Collapse All | Expand All

(-)factor.R (-1 / +2 lines)
Lines 341-348 Link Here
341
addNA <- function(x, ifany=FALSE)
341
addNA <- function(x, ifany=FALSE)
342
{
342
{
343
    if (!is.factor(x)) x <- factor(x)
343
    if (!is.factor(x)) x <- factor(x)
344
    if (ifany & !anyNA(x)) return(x)
344
    if (ifany && !anyNA(x)) return(x)
345
    ll <- levels(x)
345
    ll <- levels(x)
346
    if (!anyNA(ll)) ll <- c(ll, NA)
346
    if (!anyNA(ll)) ll <- c(ll, NA)
347
    else if (!ifany && !anyNA(x)) return(x)
347
    factor(x, levels=ll, exclude=NULL)
348
    factor(x, levels=ll, exclude=NULL)
348
}
349
}

Return to bug 16895