powered by
Create a matrix of size nrows by ncols where each column j uses its own success probability probs j.
rbinom_matrix_vec(nrows, ncols, probs)
IntegerMatrix of dimension nrows by ncols.
Integer, number of rows.
Integer, number of columns.
Numeric vector of length ncols, column-wise success probabilities in (0, 1).
set.seed(1) rbinom_matrix_vec(5, 3, rep(0.3, 3))
Run the code above in your browser using DataLab