place_random_blobs: Create Random Blobs in a Matrix

View source: R/place_random_blobs.R

place_random_blobsR Documentation

Create Random Blobs in a Matrix

Description

Create Random Blobs in a Matrix

Usage

place_random_blobs(
  m = matrix(0L, nrow = 10, ncol = 15),
  n_blobs = 5,
  min_fields = 3,
  max_fields = min_fields,
  do_plot = TRUE
)

Arguments

m

matrix of integer in which to place blobs. Default: 10 x 15-Matrix

n_blobs

number of blobs to create. Default: 5

min_fields

minimum number of fields a blob should consist of

max_fields

maximum number of fields a blob should consist of. Defaults to min_fields

do_plot

if TRUE (the default), the result matrix is plotted

Value

matrix in which fields belonging to the same blob have the same integer number and zeros indicate empty fields

Examples

set.seed(42)
place_random_blobs(n_blobs = 5, min_fields = 5, max_fields = 10)


hsonne/findblobs documentation built on April 5, 2022, 6:33 p.m.