This function triangulates the bin centroids/ means using the x and y coordinates provided in the input data frame and returns the triangular object.
Arguments
- .data
The data frame containing the bin centroids/ means.
- x
The name of the column that contains x coordinates of bin centroids/ means.
- y
The name of the column that contains y coordinates of bin centroids/ means.
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
triangulate_bin_centroids(df_bin_centroids, x, y)
#> triangulation nodes with neigbours:
#> node: (x,y): neighbours
#> 1: (-3.270358,-5.74254) [3]: 2 3 5
#> 2: (-1.83887,-5.74254) [3]: 1 3 4
#> 3: (-2.554614,-4.376826) [5]: 1 2 4 5 6
#> 4: (-1.123126,-4.376826) [4]: 2 3 6 7
#> 5: (-3.270358,-3.011112) [7]: 1 3 6 8 11 13 15
#> 6: (-1.83887,-3.011112) [5]: 3 4 5 7 8
#> 7: (-0.4073814,-3.011112) [4]: 4 6 8 9
#> 8: (-1.123126,-1.645398) [6]: 5 6 7 9 10 11
#> 9: (0.3083626,-1.645398) [3]: 7 8 10
#> 10: (1.024107,-0.2796838) [4]: 8 9 11 12
#> 11: (0.3083626,1.08603) [5]: 5 8 10 12 13
#> 12: (1.739851,1.08603) [5]: 10 11 13 14 16
#> 13: (0.3083626,3.817459) [5]: 5 11 12 14 15
#> 14: (1.739851,3.817459) [4]: 12 13 15 16
#> 15: (1.024107,5.183173) [4]: 5 13 14 16
#> 16: (2.455595,5.183173) [3]: 12 14 15
#> number of nodes: 16
#> number of arcs: 35
#> number of boundary nodes: 10
#> boundary nodes: 1 2 4 5 7 9 10 12 15 16
#> number of triangles: 20
#> number of constraints: 0