s-news
[Top] [All Lists]

lapply question

To: s-news@lists.biostat.wustl.edu
Subject: lapply question
From: Eric yang <yang_eric9@yahoo.com>
Date: Tue, 30 Aug 2005 09:11:19 -0700 (PDT)
Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:Received:Date:From:Subject:To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=W+14kfc9ZlBew9EipGj2Istr1TX0+GV8nxX1y5dXvF8wtsvnraI2f0vndwFG9Zmr2rk4UZX77HbVP1RSxpkDOvjMbW1RGlD8raFLPpaK2AwHWlWRNh/dZPMxHq5NiUNQ2e0dgBdCVO3o4TOIDt+wNto6S+egEFf3KnH9auNz+BQ= ;
 
Dear members,
 
If I have the following lapply loops
 

lapply(10:20, function(i) {

   count <- 1

   lapply(1:20, function(j, i, count) {

       lapply(1:5, function(k,j,i,count){

         count <- count +1

          rnorm(count, j, i)

       }, j, i, count)

    }, i, count)

})

How do I update the parameter "count" within the two inner-lapply loops. At present, count is always 2?

Thanks in advance for any help.

Eric

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com

<Prev in Thread] Current Thread [Next in Thread>