Skip to contents

This function determines the number of bins along the x and y axes to obtain a specific number of non-empty bins.

Usage

find_non_empty_bins(data, non_empty_bins, r2, q = 0.1)

Arguments

data

A tibble that contains the embedding.

non_empty_bins

The desired number of non-empty bins.

r2

The range of the original second embedding component.

q

The buffer amount as proportion of data range.

Value

The number of bins along the x and y axes needed to achieve a specific number of non-empty bins.

Examples

r2 <- diff(range(s_curve_noise_umap$UMAP2))/diff(range(s_curve_noise_umap$UMAP1))
find_non_empty_bins(data = s_curve_noise_umap_scaled, non_empty_bins = 5,
r2 = r2)