When using the fractal dimension function in combination with grid_metrics and small resolutions (e.g. 1), Rdimtools::est.boxcount may throw an error if there are not enough points in the grid cell. To solve this problem, either the grid size needs to be increased or the user defined functions need a check to skip grid cells with insufficient number of points.
The function below is my implementation of such a check. After some testing for minimum number of points, >3 seems to work well. I tested this on my data (drone-based lidar with resolution set to 0.5 or 1).
fd = function(X,Y,Z) {
M = cbind(X,Y,Z)
if(nrow(M)>3){
est.boxcount(M)$estdim
}
}
When using the fractal dimension function in combination with
grid_metricsand small resolutions (e.g. 1),Rdimtools::est.boxcountmay throw an error if there are not enough points in the grid cell. To solve this problem, either the grid size needs to be increased or the user defined functions need a check to skip grid cells with insufficient number of points.The function below is my implementation of such a check. After some testing for minimum number of points, >3 seems to work well. I tested this on my data (drone-based lidar with resolution set to 0.5 or 1).