But when I run the code to install the package, I get this error:
Error: object 'nndist' is not exported by 'namespace:spatstat'
Execution halted
ERROR: lazy loading failed for package 'humboldt'
removing 'C:/Users/HP/OneDrive/Documents/R/win-library/4.0/humboldt'
Error: Failed to install 'humboldt' from GitHub:
(converted from warning) installation of package ‘C:/Users/HP/AppData/Local/Temp/Rtmp8En51V/file4c9c22233edc/humboldt_1.0.0.01202021.tar.gz’ had non-zero exit status
I searched for the "nndist" and it is in "spatstat.geo" package. All the "spatstat" packages are installed when I install "spatstat".
So, I don't know if your problem is with the "humboldt" package or another one. But I figured out how to fix the "humboldt" package problem. "humboldt" use the "spatstat" package in the background for its functions. The "spatstat" has been updated, right now it is version 2, but the "humboldt" is based on version 1.64-1.
So you need to download the older version of spatstat and make sure not to update it while downloading the humboldt.
this is the code I used: #we need to use the package "devtools" to install package form github
library(devtools)
#the "spatstat" version used in "humboldt" is "1.64-1" so DONOT UPDATE IT #click no for whatever it asks about rebooting or updating
install_version("spatstat", version = "1.64-1", repos = "http://cran.us.r-project.org")