Skip to contents

This function generates the hexagonal object.

Usage

hex_binning(nldr_obj, b1 = 5, q = 0.1)

Arguments

nldr_obj

A list of a tibble contains scaled first and second columns of NLDR data, and numeric vectors representing the limits of the original NLDR data.

b1

Number of bins along the x axis.

q

The buffer amount as proportion of data range.

Value

A object that contains numeric vector that contains binwidths (a1), vertical distance (a2), bins along the x and y axes respectively (bins), numeric vector that contains hexagonal starting point coordinates all hexagonal bin centroids (centroids), hexagonal coordinates of the full grid (hex_poly), embedding components with their corresponding hexagon IDs (data_hb_id), hex bins with their corresponding standardise counts (std_cts), total number of hex bins (b), number of non-empty hex bins (m) and points within each hexagon (pts_bins).

Examples

hex_binning(nldr_obj = scurve_model_obj$nldr_obj, b1 = 5, q = 0.1)
#> $a1
#> [1] 0.2641342
#> 
#> $a2
#> [1] 0.2287469
#> 
#> $bins
#> [1] 5 7
#> 
#> $start_point
#> [1] -0.1000000 -0.1156801
#> 
#> $centroids
#> # A tibble: 35 × 3
#>        h     c_x    c_y
#>    <int>   <dbl>  <dbl>
#>  1     1 -0.1    -0.116
#>  2     2  0.164  -0.116
#>  3     3  0.428  -0.116
#>  4     4  0.692  -0.116
#>  5     5  0.957  -0.116
#>  6     6  0.0321  0.113
#>  7     7  0.296   0.113
#>  8     8  0.560   0.113
#>  9     9  0.824   0.113
#> 10    10  1.09    0.113
#> # ℹ 25 more rows
#> 
#> $hex_poly
#>      h          x           y
#> 1    1 -0.1000000  0.03681781
#> 2    1 -0.2320671 -0.03943117
#> 3    1 -0.2320671 -0.19192912
#> 4    1 -0.1000000 -0.26817809
#> 5    1  0.0320671 -0.19192912
#> 6    1  0.0320671 -0.03943117
#> 7    2  0.1641342  0.03681781
#> 8    2  0.0320671 -0.03943117
#> 9    2  0.0320671 -0.19192912
#> 10   2  0.1641342 -0.26817809
#> 11   2  0.2962013 -0.19192912
#> 12   2  0.2962013 -0.03943117
#> 13   3  0.4282684  0.03681781
#> 14   3  0.2962013 -0.03943117
#> 15   3  0.2962013 -0.19192912
#> 16   3  0.4282684 -0.26817809
#> 17   3  0.5603355 -0.19192912
#> 18   3  0.5603355 -0.03943117
#> 19   4  0.6924026  0.03681781
#> 20   4  0.5603355 -0.03943117
#> 21   4  0.5603355 -0.19192912
#> 22   4  0.6924026 -0.26817809
#> 23   4  0.8244697 -0.19192912
#> 24   4  0.8244697 -0.03943117
#> 25   5  0.9565368  0.03681781
#> 26   5  0.8244697 -0.03943117
#> 27   5  0.8244697 -0.19192912
#> 28   5  0.9565368 -0.26817809
#> 29   5  1.0886039 -0.19192912
#> 30   5  1.0886039 -0.03943117
#> 31   6  0.0320671  0.26556474
#> 32   6 -0.1000000  0.18931576
#> 33   6 -0.1000000  0.03681781
#> 34   6  0.0320671 -0.03943117
#> 35   6  0.1641342  0.03681781
#> 36   6  0.1641342  0.18931576
#> 37   7  0.2962013  0.26556474
#> 38   7  0.1641342  0.18931576
#> 39   7  0.1641342  0.03681781
#> 40   7  0.2962013 -0.03943117
#> 41   7  0.4282684  0.03681781
#> 42   7  0.4282684  0.18931576
#> 43   8  0.5603355  0.26556474
#> 44   8  0.4282684  0.18931576
#> 45   8  0.4282684  0.03681781
#> 46   8  0.5603355 -0.03943117
#> 47   8  0.6924026  0.03681781
#> 48   8  0.6924026  0.18931576
#> 49   9  0.8244697  0.26556474
#> 50   9  0.6924026  0.18931576
#> 51   9  0.6924026  0.03681781
#> 52   9  0.8244697 -0.03943117
#> 53   9  0.9565368  0.03681781
#> 54   9  0.9565368  0.18931576
#> 55  10  1.0886039  0.26556474
#> 56  10  0.9565368  0.18931576
#> 57  10  0.9565368  0.03681781
#> 58  10  1.0886039 -0.03943117
#> 59  10  1.2206710  0.03681781
#> 60  10  1.2206710  0.18931576
#> 61  11 -0.1000000  0.49431166
#> 62  11 -0.2320671  0.41806269
#> 63  11 -0.2320671  0.26556474
#> 64  11 -0.1000000  0.18931576
#> 65  11  0.0320671  0.26556474
#> 66  11  0.0320671  0.41806269
#> 67  12  0.1641342  0.49431166
#> 68  12  0.0320671  0.41806269
#> 69  12  0.0320671  0.26556474
#> 70  12  0.1641342  0.18931576
#> 71  12  0.2962013  0.26556474
#> 72  12  0.2962013  0.41806269
#> 73  13  0.4282684  0.49431166
#> 74  13  0.2962013  0.41806269
#> 75  13  0.2962013  0.26556474
#> 76  13  0.4282684  0.18931576
#> 77  13  0.5603355  0.26556474
#> 78  13  0.5603355  0.41806269
#> 79  14  0.6924026  0.49431166
#> 80  14  0.5603355  0.41806269
#> 81  14  0.5603355  0.26556474
#> 82  14  0.6924026  0.18931576
#> 83  14  0.8244697  0.26556474
#> 84  14  0.8244697  0.41806269
#> 85  15  0.9565368  0.49431166
#> 86  15  0.8244697  0.41806269
#> 87  15  0.8244697  0.26556474
#> 88  15  0.9565368  0.18931576
#> 89  15  1.0886039  0.26556474
#> 90  15  1.0886039  0.41806269
#> 91  16  0.0320671  0.72305859
#> 92  16 -0.1000000  0.64680962
#> 93  16 -0.1000000  0.49431166
#> 94  16  0.0320671  0.41806269
#> 95  16  0.1641342  0.49431166
#> 96  16  0.1641342  0.64680962
#> 97  17  0.2962013  0.72305859
#> 98  17  0.1641342  0.64680962
#> 99  17  0.1641342  0.49431166
#> 100 17  0.2962013  0.41806269
#> 101 17  0.4282684  0.49431166
#> 102 17  0.4282684  0.64680962
#> 103 18  0.5603355  0.72305859
#> 104 18  0.4282684  0.64680962
#> 105 18  0.4282684  0.49431166
#> 106 18  0.5603355  0.41806269
#> 107 18  0.6924026  0.49431166
#> 108 18  0.6924026  0.64680962
#> 109 19  0.8244697  0.72305859
#> 110 19  0.6924026  0.64680962
#> 111 19  0.6924026  0.49431166
#> 112 19  0.8244697  0.41806269
#> 113 19  0.9565368  0.49431166
#> 114 19  0.9565368  0.64680962
#> 115 20  1.0886039  0.72305859
#> 116 20  0.9565368  0.64680962
#> 117 20  0.9565368  0.49431166
#> 118 20  1.0886039  0.41806269
#> 119 20  1.2206710  0.49431166
#> 120 20  1.2206710  0.64680962
#> 121 21 -0.1000000  0.95180552
#> 122 21 -0.2320671  0.87555654
#> 123 21 -0.2320671  0.72305859
#> 124 21 -0.1000000  0.64680962
#> 125 21  0.0320671  0.72305859
#> 126 21  0.0320671  0.87555654
#> 127 22  0.1641342  0.95180552
#> 128 22  0.0320671  0.87555654
#> 129 22  0.0320671  0.72305859
#> 130 22  0.1641342  0.64680962
#> 131 22  0.2962013  0.72305859
#> 132 22  0.2962013  0.87555654
#> 133 23  0.4282684  0.95180552
#> 134 23  0.2962013  0.87555654
#> 135 23  0.2962013  0.72305859
#> 136 23  0.4282684  0.64680962
#> 137 23  0.5603355  0.72305859
#> 138 23  0.5603355  0.87555654
#> 139 24  0.6924026  0.95180552
#> 140 24  0.5603355  0.87555654
#> 141 24  0.5603355  0.72305859
#> 142 24  0.6924026  0.64680962
#> 143 24  0.8244697  0.72305859
#> 144 24  0.8244697  0.87555654
#> 145 25  0.9565368  0.95180552
#> 146 25  0.8244697  0.87555654
#> 147 25  0.8244697  0.72305859
#> 148 25  0.9565368  0.64680962
#> 149 25  1.0886039  0.72305859
#> 150 25  1.0886039  0.87555654
#> 151 26  0.0320671  1.18055245
#> 152 26 -0.1000000  1.10430347
#> 153 26 -0.1000000  0.95180552
#> 154 26  0.0320671  0.87555654
#> 155 26  0.1641342  0.95180552
#> 156 26  0.1641342  1.10430347
#> 157 27  0.2962013  1.18055245
#> 158 27  0.1641342  1.10430347
#> 159 27  0.1641342  0.95180552
#> 160 27  0.2962013  0.87555654
#> 161 27  0.4282684  0.95180552
#> 162 27  0.4282684  1.10430347
#> 163 28  0.5603355  1.18055245
#> 164 28  0.4282684  1.10430347
#> 165 28  0.4282684  0.95180552
#> 166 28  0.5603355  0.87555654
#> 167 28  0.6924026  0.95180552
#> 168 28  0.6924026  1.10430347
#> 169 29  0.8244697  1.18055245
#> 170 29  0.6924026  1.10430347
#> 171 29  0.6924026  0.95180552
#> 172 29  0.8244697  0.87555654
#> 173 29  0.9565368  0.95180552
#> 174 29  0.9565368  1.10430347
#> 175 30  1.0886039  1.18055245
#> 176 30  0.9565368  1.10430347
#> 177 30  0.9565368  0.95180552
#> 178 30  1.0886039  0.87555654
#> 179 30  1.2206710  0.95180552
#> 180 30  1.2206710  1.10430347
#> 181 31 -0.1000000  1.40929937
#> 182 31 -0.2320671  1.33305040
#> 183 31 -0.2320671  1.18055245
#> 184 31 -0.1000000  1.10430347
#> 185 31  0.0320671  1.18055245
#> 186 31  0.0320671  1.33305040
#> 187 32  0.1641342  1.40929937
#> 188 32  0.0320671  1.33305040
#> 189 32  0.0320671  1.18055245
#> 190 32  0.1641342  1.10430347
#> 191 32  0.2962013  1.18055245
#> 192 32  0.2962013  1.33305040
#> 193 33  0.4282684  1.40929937
#> 194 33  0.2962013  1.33305040
#> 195 33  0.2962013  1.18055245
#> 196 33  0.4282684  1.10430347
#> 197 33  0.5603355  1.18055245
#> 198 33  0.5603355  1.33305040
#> 199 34  0.6924026  1.40929937
#> 200 34  0.5603355  1.33305040
#> 201 34  0.5603355  1.18055245
#> 202 34  0.6924026  1.10430347
#> 203 34  0.8244697  1.18055245
#> 204 34  0.8244697  1.33305040
#> 205 35  0.9565368  1.40929937
#> 206 35  0.8244697  1.33305040
#> 207 35  0.8244697  1.18055245
#> 208 35  0.9565368  1.10430347
#> 209 35  1.0886039  1.18055245
#> 210 35  1.0886039  1.33305040
#> 
#> $data_hb_id
#> # A tibble: 1,000 × 4
#>     emb1  emb2    ID     h
#>    <dbl> <dbl> <int> <int>
#>  1 0.277 0.913     1    27
#>  2 0.697 0.538     2    19
#>  3 0.779 0.399     3    14
#>  4 0.173 0.953     4    27
#>  5 0.218 0.983     5    27
#>  6 0.593 1.05      6    28
#>  7 0.180 0.210     7    12
#>  8 0.976 0.571     8    20
#>  9 0.803 0.829     9    24
#> 10 0.932 0.410    10    15
#> # ℹ 990 more rows
#> 
#> $std_cts
#> # A tibble: 22 × 3
#>        h   n_h   w_h
#>    <int> <int> <dbl>
#>  1     6     2 0.002
#>  2     7    92 0.092
#>  3     8    64 0.064
#>  4     9    66 0.066
#>  5    12    42 0.042
#>  6    13    32 0.032
#>  7    14    69 0.069
#>  8    15    56 0.056
#>  9    18    28 0.028
#> 10    19    69 0.069
#> # ℹ 12 more rows
#> 
#> $b
#> [1] 35
#> 
#> $m
#> [1] 22
#> 
#> $pts_bins
#> # A tibble: 22 × 2
#>        h pts_list  
#>    <int> <list>    
#>  1     6 <int [2]> 
#>  2     7 <int [92]>
#>  3     8 <int [64]>
#>  4     9 <int [66]>
#>  5    12 <int [42]>
#>  6    13 <int [32]>
#>  7    14 <int [69]>
#>  8    15 <int [56]>
#>  9    18 <int [28]>
#> 10    19 <int [69]>
#> # ℹ 12 more rows
#> 
#> attr(,"class")
#> [1] "hex_bin_obj"