From Kurt.Hornik@ci.tuwien.ac.at  Sat Oct 13 08:40:59 2001
From: Kurt.Hornik@ci.tuwien.ac.at (Kurt Hornik)
Date: Sat, 13 Oct 2001 09:40:59 +0200
Subject: [Rd] Unable to use names() to set names on a 'dist' object (PR#1129)
In-Reply-To: <x2snco7ccr.fsf@blueberry.kubism.ku.dk>
References: <200110122136.XAA26079@pubhealth.ku.dk>
 <x2snco7ccr.fsf@blueberry.kubism.ku.dk>
Message-ID: <15303.61451.166220.724815@mithrandir.hornik.net>

>>>>> Peter Dalgaard BSA writes:

> kleiweg@let.rug.nl writes:
>> I am unable to set the names on a 'dist' object using the
>> function names()

> Yup, that's a bug.

> I wonder how long it has been around. The function definition is

>> get("names<-.dist")
> function (d, n) 
> {
>     if (length(n) != attr(d, "Size")) 
>         stop("invalid names for dist object")
>     attr(d, "Labels") <- n
>     d
> }

> but the value is passed as a named argument called "value", and it has
> been like that for ages.  The fix is obvious: replace "n" with "value"
> (3 times).

I will write a test for this when I find some time ...

-k
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-devel-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._


[Rd] Unable to use names() to set names on a 'dist' object (PR#1129)
Kurt Hornik