inst/snippet/binom-demo01.R

randomData <- rbinom(n=20,size=4,prob=0.5)
randomData
table(randomData)
dbinom(0:4,size=4,prob=0.5)          # matches earlier example 
dbinom(0:4,size=4,prob=0.5) * 20     # pretty close to our table above
pbinom(0:4,size=4,prob=0.5)          # same as cumsum(dbinom(...))

Try the fastR package in your browser

Any scripts or data that you put into this service are public.

fastR documentation built on May 2, 2019, 5:53 p.m.