Skip to contents

Randomly samples submatrices (quadrats) of specified size from a binary matrix, and returns the positions, submatrices, and count of 1s in each sampled quadrat.

Usage

count_subareas_random(matrix_data, sub_rows = 3, sub_cols = 3, n_samples = 100)

Arguments

matrix_data

A binary matrix of 0s and 1s.

sub_rows

Number of rows in each subgrid sample.

sub_cols

Number of columns in each subgrid sample.

n_samples

Number of subgrid samples to draw.

Value

A list of sampled subgrids. Each element is a list with:

position

Row and column start position of the sample.

submatrix

The sampled subgrid matrix.

count

Number of 1s in the sampled submatrix.