Extract hexagonal bin mean coordinates and the corresponding standardize counts.
Source:R/2d.R
extract_hexbin_mean.Rd
Extract hexagonal bin mean coordinates and the corresponding standardize counts.
Examples
r2 <- diff(range(s_curve_noise_umap$UMAP2))/diff(range(s_curve_noise_umap$UMAP1))
num_bins_x <- 4
hb_obj <- hex_binning(data = s_curve_noise_umap_scaled, bin1 = num_bins_x,
r2 = r2, q = 0.1)
all_centroids_df <- hb_obj$centroids
umap_with_hb_id <- hb_obj$data_hb_id
counts_df <- hb_obj$std_cts
extract_hexbin_mean(data_hb = umap_with_hb_id, counts_df = counts_df,
centroids_df = all_centroids_df)
#> # A tibble: 32 × 6
#> hexID c_x c_y bin_counts std_counts drop_empty
#> <int> <dbl> <dbl> <int> <dbl> <lgl>
#> 1 1 NA NA NA NA TRUE
#> 2 2 NA NA NA NA TRUE
#> 3 3 NA NA NA NA TRUE
#> 4 4 NA NA NA NA TRUE
#> 5 5 0.133 0.138 14 1 FALSE
#> 6 6 0.291 0.178 3 0.214 FALSE
#> 7 7 NA NA NA NA TRUE
#> 8 8 NA NA NA NA TRUE
#> 9 9 0.0278 0.348 3 0.214 FALSE
#> 10 10 0.330 0.419 6 0.429 FALSE
#> # ℹ 22 more rows