[R] Bug in formals<-

From: Frank E Harrell Jr <f.harrell_at_vanderbilt.edu>
Date: Tue 26 Sep 2006 - 22:58:03 GMT


I think this is new since a previous version of R:

> h <- function(x, trantab) trantab[x]
> w <- 6:4
> names(w) <- c('cat','dog','giraffe')
> w

     cat     dog giraffe
       6       5       4

>
> formals(h) <- list(x=numeric(0), trantab=w)
> h

function (x = numeric(0), trantab = c(6, 5, 4)) trantab[x]

You can see that the names have been dropped from trantab's default values. I don't see a workaround but it seems to need fixing.

Version 2.3.1 (2006-06-01)
i486-pc-linux-gnu

attached base packages:
[1] "grid" "methods" "stats" "graphics" "grDevices" "utils" [7] "datasets" "base"

other attached packages:

   lattice acepack Hmisc
"0.13-10" "1.3-2.2" "3.0-12"

-- 
Frank E Harrell Jr   Professor and Chair           School of Medicine
                      Department of Biostatistics   Vanderbilt University

______________________________________________
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Received on Wed Sep 27 09:01:42 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Tue 26 Sep 2006 - 23:30:06 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.