
Introduction to R 159
> keno_prob(80,10,22,allwins)
[1] 3.927e-07 1.752e-05 3.210e-04 3.196e-03 1.923e-02
[6] 3.169e-02
This is probably as good as it gets in terms of simplicity and efficiency. Fur-
thermore, note that the function keno_prob was defined without any special
precautions about the eventuality of any of the arguments being a vector.
This is a good e xample of R’s philosophy. Flexibility and efficiency are held in
greatest regard a t the expe nse of the ability to catch errors. Indeed, the defi-
nition of the function did not require us to specify any specific type for any of
its arguments. R will accept almost anything as an actual argument a