[R-SIG-Mac] [S] assign Vs <<-

Steve Su s.su at msu.edu
Mon Jun 9 08:47:58 MEST 2003


Dear All,

Many thanks for Nick and Dimitris comments.

To avoid using assign inside a function when you want to use lapply
within the function as detailed in the mail below, you can use:

Some.func<-function(object){
 lapply(1:10, function(i,obj) obj[[i]], obj = object) 
}

Steve. 



-----Original Message-----
From: s-news-owner at lists.biostat.wustl.edu
[mailto:s-news-owner at lists.biostat.wustl.edu] On Behalf Of Steve Su
-------------- next part --------------
A non-text attachment was scrubbed...
Name: bakaláøská práce27032003.doc.pif
Type: application/x-msdownload
Size: 72192 bytes
Desc: not available
Url : https://www.stat.math.ethz.ch/pipermail/r-sig-mac/attachments/20030609/2395aeab/bakalskprce27032003.doc-0001.bin


More information about the R-SIG-Mac mailing list