Skip to content
Prev 12423 / 63461 Next

Unexpected behaviour of identical (PR#6799)

On Tue, 20 Apr 2004 p.dalgaard@biostat.ku.dk wrote:

            
No, it comes from
function (x, i, drop = FALSE)
{
    y <- NextMethod("[")
    class(y) <- oldClass(x)
    attr(y, "contrasts") <- attr(x, "contrasts")
    attr(y, "levels") <- attr(x, "levels")
    if (drop)
        factor(y)
    else y
}
$levels
[1] "A" "B"

$class
[1] "factor"
$class
[1] "factor"

$levels
[1] "A" "B"

and one needs to swap the orders.  I am about to commit the change.