Skip to contents

This function calculates the average values of high-dimensional data within each hexagonal bin.

Usage

avg_highD_data(.data, column_start_text = "x")

Arguments

.data

A data frame containing the high-dimensional data and 2D embeddings.

column_start_text

The text that begin the column name of the high-D data

Value

A data frame with the average values of the high-dimensional data within each hexagonal bin.

Examples

training_data <- s_curve_noise_training
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
UMAP_data_with_hb_id <- s_curve_noise_umap |> dplyr::mutate(hb_id = hexbin_data_object$hb_data@cID)
df_all <- dplyr::bind_cols(training_data |> dplyr::select(-ID), UMAP_data_with_hb_id)
avg_highD_data(df_all)
#> # A tibble: 16 × 8
#>    hb_id      x1     x2      x3        x4        x5        x6         x7
#>    <int>   <dbl>  <dbl>   <dbl>     <dbl>     <dbl>     <dbl>      <dbl>
#>  1     1 -0.987  1.38   -1.16    0.00156   0.0112   -0.0293    0.00135  
#>  2     2 -0.455  1.70   -1.84    0.00791  -0.00110   0.000331 -0.00257  
#>  3     6 -0.340  0.428  -1.89    0.000996 -0.000543 -0.0536   -0.00196  
#>  4     7  0.632  1.31   -1.72    0.0103   -0.0111    0.00934   0.00106  
#>  5    11 -0.175  0.0562 -1.98    0.00204  -0.00179   0.0112   -0.00111  
#>  6    12  0.572  0.0605 -1.76    0.00273   0.0107    0.0308   -0.00430  
#>  7    13  0.980  0.552  -1.04    0.00143  -0.00296   0.0207    0.00641  
#>  8    17  0.713  0.406  -0.298  -0.0133    0.0127   -0.0697   -0.00924  
#>  9    18  0.737  1.35   -0.365  -0.000748  0.00380   0.0346    0.00109  
#> 10    24 -0.0687 1.09    0.0180  0.0105    0.00131  -0.00516   0.00346  
#> 11    28 -0.506  1.92    0.138   0.0159   -0.0149   -0.0841    0.00453  
#> 12    29 -0.890  1.13    0.641  -0.00525   0.000260  0.0278    0.0000386
#> 13    38 -0.613  1.69    1.79    0.0119   -0.00418  -0.000519 -0.00251  
#> 14    39 -0.210  0.584   1.88   -0.00330   0.00214  -0.00493  -0.000651 
#> 15    44  0.536  1.67    1.71    0.00257   0.00381  -0.0135    0.000988 
#> 16    45  0.807  0.611   1.48   -0.00346   0.00550  -0.00259  -0.00372