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

scurve_umap_scaled_obj <- s_curve_obj$nldr_scaled_obj
lim1 <- scurve_umap_scaled_obj$lim1
lim2 <- scurve_umap_scaled_obj$lim2
r2 <- diff(lim2)/diff(lim1)
gen_centroids(bin1 = 4, r2 = r2, q = 0.1)
#> Error in if (r2 > check_factor) {    a1 <- (1 + 2 * q)/(bin1 - 1)} else {    a1 <- (2 * (r2 + q * (1 + r2)))/(sqrt(3) * (bin2 - 1))}: argument is of length zero