I would like to call up or load a LAS file (Laser Point file) in my R project. My code works on a Windows 10 computer but gives an error on a on a Mac Book, M1, 2020. My code looks like this:
# Install and load required packagesrequired_packages <- c("lidR", "sf", "terra", "future", "progressr", "entropy", "e1071", "ggplot2", "gridExtra", "moments", "dplyr")install.packages(setdiff(required_packages, installed.packages()[, "Package"]))lapply(required_packages, library, character.only = TRUE)### Load LAS-File ###las_file <- "~/Documents/Masterarbeit/Training_data/UAV_data/classified_ndom_komplett.las"las <- readLAS(las_file)
I get this error message:
Error: Not compatible with requested type: [type=character; target=double].
The remaining packages are used for the rest of the code and are therefore listed in the code snippet. However, the same code works on a Windows 10 computer. There, I do not receive an error message and can read and process the LAS file. I have noticed that this problem also occurs on other Mac computers. This question is more about whether this problem is known and whether there are any solutions.
I have tried to install the R package lidR to read LAS files into R, but have encountered repeated error messages, especially problems with missing gfortran libraries such as libemutls_w. I have tried several approaches, including setting environment variables, installing gcc via homebrew, creating symlinks for missing libraries, trying to install older versions of gcc, and manually compiling the package from source. The problem persists.