s-news
[Top] [All Lists]

Re: sapply question

To: "'Chushu Gu'" <chushugu@hotmail.com>, s-news@lists.biostat.wustl.edu
Subject: Re: sapply question
From: "Liaw, Andy" <andy_liaw@merck.com>
Date: Fri, 23 Jan 2004 11:22:44 -0500
I suspect what you want is something like:
 
argList <- list(399, "cb.bootind.399.10", T)
res <- sapply(10:100, function(x, aList) do.call("outer.boot.func", c(x, aList)), argList)
 
HTH,
Andy
-----Original Message-----
From: s-news-owner@lists.biostat.wustl.edu [mailto:s-news-owner@lists.biostat.wustl.edu] On Behalf Of Chushu Gu
Sent: Thursday, January 22, 2004 8:49 PM
To: s-news@lists.biostat.wustl.edu
Subject: Re: [S] sapply question

Hi all,
 
I got a function has the following signature
 
outer.boot.func(10, 399, "cb.bootind.399.10",T)
 
What I want to do is to execute 91 times by changing the first parameter and get back a result vector.
Here is my code which is not working, could anyone give me a hand?
 
test <- list(10:100,339,"cb.bootind.399.10",T)
res <- sapply(test,function(x){outer.boot.func(x[1],x[2],x[3],x[4])})
 
Thanks,
 
Chushu Gu

------------------------------------------------------------------------------
Notice: This e-mail message, together with any attachments, contains information of Merck & Co., Inc. (One Merck Drive, Whitehouse Station, New Jersey, USA 08889), and/or its affiliates (which may be known outside the United States as Merck Frosst, Merck Sharp & Dohme or MSD and in Japan, as Banyu) that may be confidential, proprietary copyrighted and/or legally privileged. It is intended solely for the use of the individual or entity named on this message. If you are not the intended recipient, and have received this message in error, please notify us immediately by reply e-mail and then delete it from your system.
------------------------------------------------------------------------------

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