From thomas@biostat.washington.edu  Fri Dec  3 16:58:07 1999
From: thomas@biostat.washington.edu (Thomas Lumley)
Date: Fri, 3 Dec 1999 08:58:07 -0800 (PST)
Subject: [[ substitution (PR#358)
In-Reply-To: <199912031545.QAA08656@pubhealth.ku.dk>
Message-ID: <Pine.GSO.4.21.9912030853280.18666-100000@gorn.biostat.washington.edu>

On Fri, 3 Dec 1999 clive@bell-labs.com wrote:

> Full_Name: Clive
> Version: 0.90.0
> OS: Linux (RH6.0)
> Submission from: (NULL) (135.104.13.164)
> 
> 
> Probably known, but...
> 
> > z <- vector("list",4)
> > z[[1]] <- function(x)x
> Error in "[[<-"(*tmp*, 1, value = function(x) x) : incompatible types
> 
> (works fine in S4...)

In S 3 or 4 this works because functions are lists, in R they are not
lists. 

More worrying is 

	a<-list(one=sin,two=lm)
	a[[2]]<-sort  #fails
	a$two<-sort     #succeeds
	


Thomas Lumley
Assistant Professor, Biostatistics
University of Washington, Seattle

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


[[ substitution (PR#358)
Thomas Lumley