[R] Puzzled by the behaviour of rbinom().

Berry, Charles ccberry @end|ng |rom he@|th@uc@d@edu
Sun Jul 31 01:53:14 CEST 2022


Rolf,

> On Jul 30, 2022, at 4:08 PM, Rolf Turner <r.turner using auckland.ac.nz> wrote:
> 
> The index "i" in "c(i,j-1,pr)" is undefined. Should that be
> "c(j,j-1,pr)"?

Sorry, that `i' is cruft from an earlier version that used a for loop indexed by `i` 

You can just do `i <- 1L` before the sapply(...) to make it run.

Or delete it and shift the subscripts of res down by 1L.

Chuck


More information about the R-help mailing list