[R] How does the r-distribution function work

pieter claassen pieter.claassen at cs.ru.nl
Fri Jul 6 11:29:13 CEST 2007


I am trying to understand what rbinom function does.

Here is some sample code. Are both the invocations of bfunc effectively
doing the same or I am missing the point?

Thanks,
Pieter

bfunc <- function(n1,p1,sims) {
c<-rbinom(sims,n1,p1)
c
}

a=c()
b=c()
p1=.5
for (i in 1:10000){
a[i]=bfunc(30,p1,1)
}
b=bfunc(30,p1,10000)



More information about the R-help mailing list