0

I have used this code many times over the past year and am now getting an odd error when I try to calculate rumple index.

Here is a simplified version of the code.

library(lidR)

lidar <-readALSLAS("F:/FSF_lidR/Plot_NLAS/FSF_1_N.las", filter = "-keep_classification 3 4 5 -drop_z_below 0 -drop_z_above 48") # read in clipped plot LAS data

las <-filter_surfacepoints(lidar,1)

ri  <- rumple_index(las$X,las$Y,las$Z)

Error message:

Error in loadNamespace(x): there is no package called ‘geometry’

'rumple_index' returned NA.

Has there possibly been an update to a supporting package I need to reinstall? Thanks for any advice or thoughts.

MW

3
  • Have you tried installing the package "geometry"?
    – user10917479
    Jun 27, 2022 at 13:56
  • Hi Adam, I didn't see a package called that...but now I do and it solved my issues. I am not sure why I have to load it separately now....but appreciate you pointing out my silly error. Thank you.
    – MEW
    Jun 27, 2022 at 14:19
  • 1
    If you look at CRAN, geometry is in the Suggests line of the package. So that means it won't load and isn't required for the entire lidR package, just parts of it. It's generally good practice when developing a package to notify the user of this when attempting to run a function that needs it. But they didn't here. Regardless, the R error itself tips you off to what the problem is.
    – user10917479
    Jun 27, 2022 at 14:40

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Browse other questions tagged or ask your own question.