Skip to contents

This function generates all possible centroids in the hexagonal grid.

Usage

gen_centroids(bin1 = 2, r2, q = 0.1)

Arguments

bin1

Number of bins along the x axis.

r2

The ratio of the ranges of the original embedding components.

q

The buffer amount as proportion of data range.

Value

A tibble contains hexIDs, x and y coordinates (hexID, c_x, c_y respectively) of all hexagon bin centroids.

Examples

r2 <- diff(range(s_curve_noise_umap$UMAP2))/diff(range(s_curve_noise_umap$UMAP1))
gen_centroids(bin1 = 4, r2 = r2, q = 0.1)
#> # A tibble: 32 × 3
#>    hexID     c_x    c_y
#>    <int>   <dbl>  <dbl>
#>  1     1 -0.1    -0.202
#>  2     2  0.283  -0.202
#>  3     3  0.666  -0.202
#>  4     4  1.05   -0.202
#>  5     5  0.0915  0.130
#>  6     6  0.474   0.130
#>  7     7  0.857   0.130
#>  8     8  1.24    0.130
#>  9     9 -0.1     0.461
#> 10    10  0.283   0.461
#> # ℹ 22 more rows