Learn R Programming

bunsen (version 0.1.1)

rbinom_matrix_vec: Generate a matrix of binomial random values

Description

Create a matrix of size nrows by ncols where each column j uses its own success probability probs j.

Usage

rbinom_matrix_vec(nrows, ncols, probs)

Value

IntegerMatrix of dimension nrows by ncols.

Arguments

nrows

Integer, number of rows.

ncols

Integer, number of columns.

probs

Numeric vector of length ncols, column-wise success probabilities in (0, 1).

Examples

Run this code
set.seed(1)
rbinom_matrix_vec(5, 3, rep(0.3, 3))

Run the code above in your browser using DataLab