Dear Nico,
I am a PhD-candidate under Prof. Oliver Nakoinz researching the relationships of fortifications and landscape via digital measures using R. I have to preface that I have almost no structured education in programming, though. At the most basic I am trying to compile a cost surface that combines the impact of elevation and wetness both.
Attached I have tried to provide a reproducible sample. The only needed inputs are two rasterimages: „output_SRTMGL3_wettness“ in line 91 (very big, downloadable here: https://cloud.rz.uni-kiel.de/index.php/s/Y8kJM4QNp76XnRm 111MB) „output_SRTMGL3“ in line 136 (within this GIT project) The current problem commences in line 162 (Fehler in terra::values(x)[, 1] : falsche Anzahl von Dimensionen „wrong number of dimensions“) while using create_cs().
Because this project has been ongoing for a while, I am using an outdated version of R and r-packages, since every update has messed up other portions of the script previously.
sessionInfo() R version 4.4.1 (2024-06-14 ucrt) Platform: x86_64-w64-mingw32/x64 Running under: Windows 11 x64 (build 26100)
Matrix products: default
locale:
[1] LC_COLLATE=German_Germany.utf8 LC_CTYPE=German_Germany.utf8 LC_MONETARY=German_Germany.utf8 LC_NUMERIC=C
[5] LC_TIME=German_Germany.utf8
time zone: Europe/Berlin tzcode source: internal
attached base packages: [1] stats graphics grDevices utils datasets methods base
other attached packages: [1] whitebox_2.4.0 terra_1.7-78 leastcostpath_2.0.12 raster_3.6-26 sp_2.1-4
loaded via a namespace (and not attached):
[1] s2_1.1.7 codetools_0.2-20 Matrix_1.7-0 lattice_0.22-6 e1071_1.7-14 magrittr_2.0.3 iterators_1.0.14
[8] KernSmooth_2.23-24 wk_0.9.4 classInt_0.4-10 sf_1.0-17 foreach_1.5.2 grid_4.4.1 DBI_1.2.3
[15] proxy_0.4-27 class_7.3-22 compiler_4.4.1 tools_4.4.1 Rcpp_1.0.13 units_0.8-5
I would be very grateful for any kind of input or feedback.