Applies the voxels_counting function on a grid base point cloud.

stand_counting(
  cloud,
  xy.res,
  z.res = NULL,
  points.min = NULL,
  min_size,
  edge_sizes = NULL,
  length_out = 10,
  bootstrap = FALSE,
  R = NULL,
  progress = TRUE,
  parallel = FALSE,
  threads = NULL
)

Arguments

cloud

A data.table of a point cloud with xyz coordinates in the first three columns.

xy.res

A positive numeric vector describing the grid resolution of the xy coordinates to perform.

z.res

A positive numeric vector of length 1 describing the vertical resolution. If z.res = NULL vertical profiles are not used.

points.min

A positive numeric vector of length 1 minimum number of points to retain a sub-grid.

min_size

A positive numeric vector of length 1 describing the minimum cube edge length to perform. This is required if edge_sizes = NULL.

edge_sizes

A positive numeric vector describing the edge length of the different cubes to perform within each subgrid when z.res = NULL. If edge_sizes = NULL, it uses the maximum range of values for the xyz coordinates.

length_out

A positive interger of length 1 indicating the number of different edge lengths to use for each subgrid. This is required if edge_sizes = NULL.

bootstrap

Logical. If TRUE, it computes a bootstrap on the H index calculations. FALSE as default.

R

A positive integer of length 1 indicating the number of bootstrap replicates. This need to be used if bootstrap = TRUE.

progress

Logical, if TRUE displays a graphical progress bar. TRUE as default.

parallel

Logical, if TRUE it uses a parallel processing for the voxelization. FALSE as default.

threads

An integer >= 0 describing the number of threads to use. This need to be used if parallel = TRUE.

Value

A data.table with the summary of the voxels per grid created with their features.

Author

J. Antonio Guzmán Q.

Examples


data(pc_tree)

#Applying stand_counting.
# \donttest{
stand_counting(pc_tree, xy.res = c(4, 4), min_size = 3)
#> Estimating stand_counting
  |                                                                            
  |                                                                      |   0%
  |                                                                            
  |=======================                                               |  33%
  |                                                                            
  |===============================================                       |  67%
  |                                                                            
  |======================================================================| 100%
#>            X        Y   Edge.X   Edge.Y   Edge.Z N_voxels    Volume   Surface
#>  1:  8.63575 -1.53375 6.036600 6.036600 6.036600        1 219.97696 36.440539
#>  2:  8.63575 -1.53375 4.093419 4.093419 4.093419        2 137.17931 16.756080
#>  3:  8.63575 -1.53375 4.424126 4.424126 4.424126        2 173.18582 19.572887
#>  4:  8.63575 -1.53375 4.781550 4.781550 4.781550        2 218.64324 22.863219
#>  5:  8.63575 -1.53375 5.167850 5.167850 5.167850        2 276.03221 26.706676
#>  6:  8.63575 -1.53375 5.585360 5.585360 5.585360        2 348.48451 31.196245
#>  7:  8.63575 -1.53375 3.242369 3.242369 3.242369        8 272.69518 42.051837
#>  8:  8.63575 -1.53375 3.504320 3.504320 3.504320        8 344.27159 49.121029
#>  9:  8.63575 -1.53375 3.787433 3.787433 3.787433        8 434.63520 57.378598
#> 10:  8.63575 -1.53375 3.000000 3.000000 3.000000        9 243.00000 36.000000
#> 11:  8.63575  2.46625 3.800350 3.800350 3.800350        1  54.88718 14.442662
#> 12:  8.63575  2.46625 3.421197 3.421197 3.421197        2  80.08744 11.704591
#> 13:  8.63575  2.46625 3.512283 3.512283 3.512283        2  86.65597 12.336132
#> 14:  8.63575  2.46625 3.605794 3.605794 3.605794        2  93.76325 13.001748
#> 15:  8.63575  2.46625 3.701794 3.701794 3.701794        2 101.45344 13.703279
#> 16:  8.63575  2.46625 3.000000 3.000000 3.000000        4 108.00000 18.000000
#> 17:  8.63575  2.46625 3.079872 3.079872 3.079872        4 116.85785 18.971220
#> 18:  8.63575  2.46625 3.161870 3.161870 3.161870        4 126.44219 19.994843
#> 19:  8.63575  2.46625 3.246051 3.246051 3.246051        4 136.81261 21.073698
#> 20:  8.63575  2.46625 3.332474 3.332474 3.332474        4 148.03358 22.210764
#> 21: 12.63575 -1.53375 3.881850 3.881850 3.881850        1  58.49467 15.068760
#> 22: 12.63575 -1.53375 3.665795 3.665795 3.665795        2  98.52232 13.438055
#> 23: 12.63575 -1.53375 3.772276 3.772276 3.772276        2 107.35949 14.230068
#> 24: 12.63575 -1.53375 3.562320 3.562320 3.562320        3 135.61884 25.380247
#> 25: 12.63575 -1.53375 3.000000 3.000000 3.000000        4 108.00000 18.000000
#> 26: 12.63575 -1.53375 3.087141 3.087141 3.087141        4 117.68730 19.060885
#> 27: 12.63575 -1.53375 3.176814 3.176814 3.176814        4 128.24352 20.184297
#> 28: 12.63575 -1.53375 3.269092 3.269092 3.269092        4 139.74660 21.373920
#> 29: 12.63575 -1.53375 3.364049 3.364049 3.364049        4 152.28148 22.633657
#> 30: 12.63575 -1.53375 3.461766 3.461766 3.461766        4 165.94071 23.967641
#> 31: 12.63575  2.46625 3.272350 3.272350 3.272350        1  35.04122 10.708274
#> 32: 12.63575  2.46625 3.000000 3.000000 3.000000        2  54.00000  9.000000
#> 33: 12.63575  2.46625 3.029106 3.029106 3.029106        2  55.58700  9.175481
#> 34: 12.63575  2.46625 3.058494 3.058494 3.058494        2  57.22065  9.354383
#> 35: 12.63575  2.46625 3.088167 3.088167 3.088167        2  58.90230  9.536774
#> 36: 12.63575  2.46625 3.118128 3.118128 3.118128        2  60.63337  9.722721
#> 37: 12.63575  2.46625 3.148380 3.148380 3.148380        2  62.41532  9.912294
#> 38: 12.63575  2.46625 3.178925 3.178925 3.178925        2  64.24964 10.105562
#> 39: 12.63575  2.46625 3.209766 3.209766 3.209766        2  66.13787 10.302600
#> 40: 12.63575  2.46625 3.240907 3.240907 3.240907        2  68.08159 10.503478
#>            X        Y   Edge.X   Edge.Y   Edge.Z N_voxels    Volume   Surface
#>     Density_mean Density_sd           H      Hmax Equitavility Negentropy
#>  1:    1129.0173         NA 0.000000000 0.0000000          NaN 0.00000000
#>  2:    1227.6738   490.3642 0.652714053 0.6931472   0.94166733 0.04043313
#>  3:    1050.9947   726.8000 0.568302928 0.6931472   0.81988782 0.12484425
#>  4:     899.7421   879.8931 0.430004503 0.6931472   0.62036536 0.26314268
#>  5:     770.2568   892.4793 0.303336761 0.6931472   0.43762244 0.38981042
#>  6:     659.4063   900.3550 0.087163900 0.6931472   0.12575093 0.60598328
#>  7:     489.1820   427.6987 1.769505113 2.0794415   0.85095208 0.30993643
#>  8:     418.7819   475.6247 1.573421589 2.0794415   0.75665584 0.50601995
#>  9:     358.5135   551.4770 1.188607837 2.0794415   0.57159954 0.89083370
#> 10:     507.9259   450.8237 1.838350512 2.1972246   0.83666937 0.35887406
#> 11:    1123.2001         NA 0.000000000 0.0000000          NaN 0.00000000
#> 12:     692.9759   952.3469 0.074159041 0.6931472   0.10698888 0.61898814
#> 13:     657.4994   913.7950 0.049608033 0.6931472   0.07156926 0.64353915
#> 14:     623.8392   874.0840 0.029470720 0.6931472   0.04251726 0.66367646
#> 15:     591.9021   834.0831 0.013096540 0.6931472   0.01889431 0.68005064
#> 16:     450.6111   585.2601 0.817029145 1.3862944   0.58936195 0.56926522
#> 17:     427.5424   622.7369 0.688428257 1.3862944   0.49659602 0.69786610
#> 18:     405.6546   646.6090 0.562173598 1.3862944   0.40552253 0.82412076
#> 19:     384.8874   664.5126 0.419316150 1.3862944   0.30247267 0.96697821
#> 20:     365.1833   676.8233 0.257410815 1.3862944   0.18568265 1.12888355
#> 21:     896.4905         NA 0.000000000 0.0000000          NaN 0.00000000
#> 22:     502.6397   699.7898 0.045494984 0.6931472   0.06563539 0.64765220
#> 23:     474.6639   667.4997 0.019330851 0.6931472   0.02788852 0.67381633
#> 24:     354.8429   576.3660 0.196023146 1.0986123   0.17842796 0.90258914
#> 25:     375.2500   530.7591 0.641665079 1.3862944   0.46286351 0.74462928
#> 26:     354.3644   528.6871 0.569650394 1.3862944   0.41091590 0.81664397
#> 27:     334.6413   521.3135 0.516605101 1.3862944   0.37265181 0.86968926
#> 28:     316.0160   512.7884 0.466511522 1.3862944   0.33651693 0.91978284
#> 29:     298.4272   507.4900 0.401308295 1.3862944   0.28948274 0.98498607
#> 30:     281.8175   503.5746 0.316780028 1.3862944   0.22850849 1.06951433
#> 31:     464.5006         NA 0.000000000 0.0000000          NaN 0.00000000
#> 32:     276.3333   368.9526 0.127525682 0.6931472   0.18398067 0.56562150
#> 33:     271.0485   366.3661 0.106159937 0.6931472   0.15315641 0.58698724
#> 34:     265.8647   364.8019 0.077368810 0.6931472   0.11161960 0.61577837
#> 35:     260.7800   361.8290 0.053454634 0.6931472   0.07711873 0.63969255
#> 36:     255.7926   357.6726 0.034771762 0.6931472   0.05016505 0.65837542
#> 37:     250.9006   352.1162 0.025079802 0.6931472   0.03618251 0.66806738
#> 38:     246.1021   346.7814 0.013233745 0.6931472   0.01909226 0.67991344
#> 39:     241.3954   340.6983 0.007943344 0.6931472   0.01145982 0.68520384
#> 40:     236.7787   334.5864 0.003545891 0.6931472   0.00511564 0.68960129
#>     Density_mean Density_sd           H      Hmax Equitavility Negentropy
# }

#Applying stand_counting using bootstrap in the H index.
# \donttest{
stand_counting(pc_tree,
               xy.res = c(4, 4),
               min_size = 3,
               bootstrap = TRUE,
               R = 10)
#> Estimating stand_counting
  |                                                                            
  |                                                                      |   0%
  |                                                                            
  |=======================                                               |  33%
  |                                                                            
  |===============================================                       |  67%
  |                                                                            
  |======================================================================| 100%
#>            X        Y   Edge.X   Edge.Y   Edge.Z N_voxels    Volume   Surface
#>  1:  8.63575 -1.53375 6.036600 6.036600 6.036600        1 219.97696 36.440539
#>  2:  8.63575 -1.53375 4.093419 4.093419 4.093419        2 137.17931 16.756080
#>  3:  8.63575 -1.53375 4.424126 4.424126 4.424126        2 173.18582 19.572887
#>  4:  8.63575 -1.53375 4.781550 4.781550 4.781550        2 218.64324 22.863219
#>  5:  8.63575 -1.53375 5.167850 5.167850 5.167850        2 276.03221 26.706676
#>  6:  8.63575 -1.53375 5.585360 5.585360 5.585360        2 348.48451 31.196245
#>  7:  8.63575 -1.53375 3.242369 3.242369 3.242369        8 272.69518 42.051837
#>  8:  8.63575 -1.53375 3.504320 3.504320 3.504320        8 344.27159 49.121029
#>  9:  8.63575 -1.53375 3.787433 3.787433 3.787433        8 434.63520 57.378598
#> 10:  8.63575 -1.53375 3.000000 3.000000 3.000000        9 243.00000 36.000000
#> 11:  8.63575  2.46625 3.800350 3.800350 3.800350        1  54.88718 14.442662
#> 12:  8.63575  2.46625 3.421197 3.421197 3.421197        2  80.08744 11.704591
#> 13:  8.63575  2.46625 3.512283 3.512283 3.512283        2  86.65597 12.336132
#> 14:  8.63575  2.46625 3.605794 3.605794 3.605794        2  93.76325 13.001748
#> 15:  8.63575  2.46625 3.701794 3.701794 3.701794        2 101.45344 13.703279
#> 16:  8.63575  2.46625 3.000000 3.000000 3.000000        4 108.00000 18.000000
#> 17:  8.63575  2.46625 3.079872 3.079872 3.079872        4 116.85785 18.971220
#> 18:  8.63575  2.46625 3.161870 3.161870 3.161870        4 126.44219 19.994843
#> 19:  8.63575  2.46625 3.246051 3.246051 3.246051        4 136.81261 21.073698
#> 20:  8.63575  2.46625 3.332474 3.332474 3.332474        4 148.03358 22.210764
#> 21: 12.63575 -1.53375 3.881850 3.881850 3.881850        1  58.49467 15.068760
#> 22: 12.63575 -1.53375 3.665795 3.665795 3.665795        2  98.52232 13.438055
#> 23: 12.63575 -1.53375 3.772276 3.772276 3.772276        2 107.35949 14.230068
#> 24: 12.63575 -1.53375 3.562320 3.562320 3.562320        3 135.61884 25.380247
#> 25: 12.63575 -1.53375 3.000000 3.000000 3.000000        4 108.00000 18.000000
#> 26: 12.63575 -1.53375 3.087141 3.087141 3.087141        4 117.68730 19.060885
#> 27: 12.63575 -1.53375 3.176814 3.176814 3.176814        4 128.24352 20.184297
#> 28: 12.63575 -1.53375 3.269092 3.269092 3.269092        4 139.74660 21.373920
#> 29: 12.63575 -1.53375 3.364049 3.364049 3.364049        4 152.28148 22.633657
#> 30: 12.63575 -1.53375 3.461766 3.461766 3.461766        4 165.94071 23.967641
#> 31: 12.63575  2.46625 3.272350 3.272350 3.272350        1  35.04122 10.708274
#> 32: 12.63575  2.46625 3.000000 3.000000 3.000000        2  54.00000  9.000000
#> 33: 12.63575  2.46625 3.029106 3.029106 3.029106        2  55.58700  9.175481
#> 34: 12.63575  2.46625 3.058494 3.058494 3.058494        2  57.22065  9.354383
#> 35: 12.63575  2.46625 3.088167 3.088167 3.088167        2  58.90230  9.536774
#> 36: 12.63575  2.46625 3.118128 3.118128 3.118128        2  60.63337  9.722721
#> 37: 12.63575  2.46625 3.148380 3.148380 3.148380        2  62.41532  9.912294
#> 38: 12.63575  2.46625 3.178925 3.178925 3.178925        2  64.24964 10.105562
#> 39: 12.63575  2.46625 3.209766 3.209766 3.209766        2  66.13787 10.302600
#> 40: 12.63575  2.46625 3.240907 3.240907 3.240907        2  68.08159 10.503478
#>            X        Y   Edge.X   Edge.Y   Edge.Z N_voxels    Volume   Surface
#>     Density_mean Density_sd           H      Hmax Equitavility Negentropy
#>  1:    1129.0173         NA 0.000000000 0.0000000          NaN 0.00000000
#>  2:    1227.6738   490.3642 0.652714053 0.6931472   0.94166733 0.04043313
#>  3:    1050.9947   726.8000 0.568302928 0.6931472   0.81988782 0.12484425
#>  4:     899.7421   879.8931 0.430004503 0.6931472   0.62036536 0.26314268
#>  5:     770.2568   892.4793 0.303336761 0.6931472   0.43762244 0.38981042
#>  6:     659.4063   900.3550 0.087163900 0.6931472   0.12575093 0.60598328
#>  7:     489.1820   427.6987 1.769505113 2.0794415   0.85095208 0.30993643
#>  8:     418.7819   475.6247 1.573421589 2.0794415   0.75665584 0.50601995
#>  9:     358.5135   551.4770 1.188607837 2.0794415   0.57159954 0.89083370
#> 10:     507.9259   450.8237 1.838350512 2.1972246   0.83666937 0.35887406
#> 11:    1123.2001         NA 0.000000000 0.0000000          NaN 0.00000000
#> 12:     692.9759   952.3469 0.074159041 0.6931472   0.10698888 0.61898814
#> 13:     657.4994   913.7950 0.049608033 0.6931472   0.07156926 0.64353915
#> 14:     623.8392   874.0840 0.029470720 0.6931472   0.04251726 0.66367646
#> 15:     591.9021   834.0831 0.013096540 0.6931472   0.01889431 0.68005064
#> 16:     450.6111   585.2601 0.817029145 1.3862944   0.58936195 0.56926522
#> 17:     427.5424   622.7369 0.688428257 1.3862944   0.49659602 0.69786610
#> 18:     405.6546   646.6090 0.562173598 1.3862944   0.40552253 0.82412076
#> 19:     384.8874   664.5126 0.419316150 1.3862944   0.30247267 0.96697821
#> 20:     365.1833   676.8233 0.257410815 1.3862944   0.18568265 1.12888355
#> 21:     896.4905         NA 0.000000000 0.0000000          NaN 0.00000000
#> 22:     502.6397   699.7898 0.045494984 0.6931472   0.06563539 0.64765220
#> 23:     474.6639   667.4997 0.019330851 0.6931472   0.02788852 0.67381633
#> 24:     354.8429   576.3660 0.196023146 1.0986123   0.17842796 0.90258914
#> 25:     375.2500   530.7591 0.641665079 1.3862944   0.46286351 0.74462928
#> 26:     354.3644   528.6871 0.569650394 1.3862944   0.41091590 0.81664397
#> 27:     334.6413   521.3135 0.516605101 1.3862944   0.37265181 0.86968926
#> 28:     316.0160   512.7884 0.466511522 1.3862944   0.33651693 0.91978284
#> 29:     298.4272   507.4900 0.401308295 1.3862944   0.28948274 0.98498607
#> 30:     281.8175   503.5746 0.316780028 1.3862944   0.22850849 1.06951433
#> 31:     464.5006         NA 0.000000000 0.0000000          NaN 0.00000000
#> 32:     276.3333   368.9526 0.127525682 0.6931472   0.18398067 0.56562150
#> 33:     271.0485   366.3661 0.106159937 0.6931472   0.15315641 0.58698724
#> 34:     265.8647   364.8019 0.077368810 0.6931472   0.11161960 0.61577837
#> 35:     260.7800   361.8290 0.053454634 0.6931472   0.07711873 0.63969255
#> 36:     255.7926   357.6726 0.034771762 0.6931472   0.05016505 0.65837542
#> 37:     250.9006   352.1162 0.025079802 0.6931472   0.03618251 0.66806738
#> 38:     246.1021   346.7814 0.013233745 0.6931472   0.01909226 0.67991344
#> 39:     241.3954   340.6983 0.007943344 0.6931472   0.01145982 0.68520384
#> 40:     236.7787   334.5864 0.003545891 0.6931472   0.00511564 0.68960129
#>     Density_mean Density_sd           H      Hmax Equitavility Negentropy
#>     H_boot_mean  H_boot_sd Equitavility_boot Negentropy_boot
#>  1:   0.0000000 0.00000000               NaN      0.00000000
#>  2:   0.6729306 0.02131013         0.9708337      0.02021656
#>  3:   0.6432095 0.06446929         0.9279551      0.04993770
#>  4:   0.6142044 0.12710999         0.8861096      0.07894280
#>  5:   0.5762041 0.18829632         0.8312867      0.11694313
#>  6:   0.3901555 0.31938123         0.5628755      0.30299164
#>  7:   1.8107582 0.10958978         0.8707906      0.26868338
#>  8:   1.6242944 0.13331083         0.7811205      0.45514713
#>  9:   1.3546930 0.26986746         0.6514696      0.72474855
#> 10:   1.8420557 0.20561569         0.8383557      0.35516887
#> 11:   0.0000000 0.00000000               NaN      0.00000000
#> 12:   0.2598555 0.29899968         0.3748922      0.43329170
#> 13:   0.3713776 0.33917491         0.5357846      0.32176957
#> 14:   0.2285737 0.32058619         0.3297621      0.46457352
#> 15:   0.2851168 0.35117664         0.4113366      0.40803038
#> 16:   1.0342028 0.19417507         0.7460196      0.35209153
#> 17:   0.9160282 0.22023388         0.6607747      0.47026612
#> 18:   0.7983731 0.30946703         0.5759044      0.58792130
#> 19:   0.9179467 0.36180768         0.6621585      0.46834771
#> 20:   0.6853832 0.45846077         0.4943995      0.70091117
#> 21:   0.0000000 0.00000000               NaN      0.00000000
#> 22:   0.4340863 0.33444616         0.6262542      0.25906088
#> 23:   0.5583839 0.28410591         0.8055777      0.13476327
#> 24:   0.5699357 0.37770617         0.5187778      0.52867657
#> 25:   0.8394854 0.18153200         0.6055607      0.54680894
#> 26:   0.7735209 0.34335352         0.5579774      0.61277341
#> 27:   0.6037548 0.13993045         0.4355171      0.78253952
#> 28:   0.6719169 0.26052246         0.4846856      0.71437742
#> 29:   0.6446617 0.27836866         0.4650251      0.74163263
#> 30:   0.4334034 0.21644852         0.3126345      0.95289096
#> 31:   0.0000000 0.00000000               NaN      0.00000000
#> 32:   0.4103364 0.29810870         0.5919903      0.28281075
#> 33:   0.3996536 0.30936944         0.5765782      0.29349362
#> 34:   0.5084137 0.29744921         0.7334859      0.18473351
#> 35:   0.4372702 0.33033581         0.6308475      0.25587702
#> 36:   0.2322844 0.31802554         0.3351155      0.46086279
#> 37:   0.2255000 0.32270720         0.3253278      0.46764716
#> 38:   0.4891731 0.32842939         0.7057277      0.20397403
#> 39:   0.3505453 0.36113413         0.5057299      0.34260192
#> 40:   0.3483465 0.36345179         0.5025578      0.34480064
#>     H_boot_mean  H_boot_sd Equitavility_boot Negentropy_boot
# }