From p.dalgaard@biostat.ku.dk  Fri Oct 12 22:55:00 2001
From: p.dalgaard@biostat.ku.dk (Peter Dalgaard BSA)
Date: 12 Oct 2001 23:55:00 +0200
Subject: [Rd] Unable to use names() to set names on a 'dist' object (PR#1129)
In-Reply-To: <200110122136.XAA26079@pubhealth.ku.dk>
References: <200110122136.XAA26079@pubhealth.ku.dk>
Message-ID: <x2snco7ccr.fsf@blueberry.kubism.ku.dk>

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

-- 
   O__  ---- Peter Dalgaard             Blegdamsvej 3  
  c/ /'_ --- Dept. of Biostatistics     2200 Cph. N   
 (*) \(*) -- University of Copenhagen   Denmark      Ph: (+45) 35327918
~~~~~~~~~~ - (p.dalgaard@biostat.ku.dk)             FAX: (+45) 35327907
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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)
Peter Dalgaard BSA