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

Kurt Hornik Kurt.Hornik@ci.tuwien.ac.at
Sat, 13 Oct 2001 09:40:59 +0200


>>>>> 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
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._