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

Peter Dalgaard BSA p.dalgaard@biostat.ku.dk
12 Oct 2001 23:55:00 +0200


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