Skip to contents

This function assigns the data to hexagons.

Usage

assign_data(data, centroid_df)

Arguments

data

data A tibble or data frame.

centroid_df

The dataset with centroid coordinates.

Value

A tibble contains embedding components and corresponding hexagon ID.

Examples

all_centroids_df <- s_curve_obj$s_curve_umap_hb_obj$centroids
assign_data(data = s_curve_noise_umap_scaled, centroid_df = all_centroids_df)
#> # A tibble: 3,750 × 4
#>     UMAP1  UMAP2    ID hb_id
#>     <dbl>  <dbl> <int> <int>
#>  1 0.276  0.915      1    18
#>  2 0.927  0.347      2    12
#>  3 0.810  0.242      3     7
#>  4 0.137  0.657      5    13
#>  5 0.476  0.799      6    14
#>  6 0.0485 0.0657     7     5
#>  7 0.737  0.851      9    15
#>  8 0.833  0.224     10     7
#>  9 0.909  0.371     11    12
#> 10 0.0890 0.194     12     5
#> # ℹ 3,740 more rows