This function identifies hexagons with low density based on the mean density of their neighboring hexagons.
Usage
find_low_density_hexagons(
df_bin_centroids_all,
num_bins_x,
df_bin_centroids_low,
col_std_counts = "std_counts",
col_hb_id = "hexID",
col_hb_id_low = "hexID"
)
Arguments
- df_bin_centroids_all
The data frame containing all hexagonal bin centroids.
- num_bins_x
Number of bins along the x-axis for hexagon binning.
- df_bin_centroids_low
The data frame containing identified low-density hexagonal bin centroids.
- col_std_counts
The name of the column containing the standardized counts.
- col_hb_id
The name of the column containing the hexagonal bin IDs in
df_bin_centroids_all
.- col_hb_id_low
The name of the column containing the hexagonal bin IDs in
df_bin_centroids_low
.
Value
A vector containing the IDs of hexagons to be removed after investigating their neighboring bins.
Examples
num_bins_x <- 4
shape_value <- 1.833091
hexbin_data_object <- extract_hexbin_centroids(nldr_df = s_curve_noise_umap,
num_bins = num_bins_x, shape_val = shape_value)
df_bin_centroids <- hexbin_data_object$hexdf_data
df_bin_centroids_low <- df_bin_centroids |>
dplyr::filter(std_counts <= 0.2222222)
find_low_density_hexagons(df_bin_centroids_all = df_bin_centroids, num_bins_x = num_bins_x,
df_bin_centroids_low = df_bin_centroids_low)
#> Don't need to remove low-density hexagonal bins.
#> NULL