On Aug 17, 2009, at 1:40 PM, MarcioRibeiro wrote:
Ok, the LIST function I understood...
I didn't see how you got a "random" input to that function. Would seem
to need one of the r functions as input.
What I would like now is to simulate this Function A many times (S)
in order
to get S
Ok, the LIST function I understood...
What I would like now is to simulate this Function A many times (S) in order
to get S results for the MEAN and for the VARIANCE...
Zhiliang Ma wrote:
>
> in order to return more multiple variables, you can put them in a list
> and then return this list.
>
in order to return more multiple variables, you can put them in a list
and then return this list.
e.g.
#Function A
boot<-function(a,b,c){
mean_boot<-(a+b)/2
var_boot<-c
list(mean_boot = mean_boot, var_boot = var_boot)
}
out <- boot(1,2,3)
out
$mean_boot
[1] 1.5
$var_boot
[1] 3
On Fri, Aug 1
Hi listers,
I am working on a simulation... But I am having some troubles...
Suppose I have a function A which produces two results (mean and
variance)...
Then I would like to simulate this function A with a function B many times
using the results from function A
For example:
#Function A
boot<-fu
4 matches
Mail list logo