Skip to contents

This function calculates the mean density of hexagonal bins based on their neighboring bins.

Usage

compute_mean_density_hex(df_bin_centroids, bin1)

Arguments

df_bin_centroids

A tibble that contains information about hexagonal bin centroids, including the hexagon ID and the standard normalized counts (std_counts).

bin1

The number of bins along the x-axis for the hexagonal grid.

Value

A tibble contains hexagonal IDs and the mean density of each hexagonal bin based on its neighboring bins.

Examples

num_bins_x <- 4
df_bin_centroids <- s_curve_obj$s_curve_umap_model_obj$df_bin_centroids
compute_mean_density_hex(df_bin_centroids, bin1 = num_bins_x)
#> # A tibble: 125 × 2
#>    hb_id mean_density
#>    <int>        <dbl>
#>  1    18        0.203
#>  2    19        0.125
#>  3    20        0.203
#>  4    34        0.432
#>  5    35        0.469
#>  6    36        0.414
#>  7    37        0.349
#>  8    38        0.542
#>  9    39        0.465
#> 10    40        0.422
#> # ℹ 115 more rows