generate_board_mat: generates a matrix of 0 and 1

Description Usage Arguments Value Examples

View source: R/utils.R

Description

generates a matrix of 0 and 1

Usage

1
generate_board_mat(n = 5, p = 0.25)

Arguments

n

integer, the dimension of the square matrix

p

a number between 0, 1, it's the probability to have 0's

Value

board with n rows and n columns and floor(p*n^2) 0's, the rest are 1's

Examples

1
generate_board_mat(n = 5, p = 0.25)

edenhu11/percolate documentation built on Nov. 4, 2019, 11:32 a.m.