source(
here::here("R/02_Main_analyses/01_Spatial/01_Run_spatial_continental.R")
)Reproducibility
{renv}
This project uses the {renv} package to manage dependencies. To install the required packages, run the following command in the R console:
renv::restore()This will install all the packages listed in the renv.lock file.
{sjSDM}
This project uses {sjSDM} (Scalable Joint Species Distribution Models), which requires a Python back-end (PyTorch). After installing the R package, set up the Python environment with:
sjSDM::install_sjSDM()You can verify the setup using the project helper function:
source("R/___setup_project___.R")
verify_sjsdm_setup(){targets}
The project is built as a {targets} pipeline. Each analysis configuration has its own dedicated pipeline run. To execute a pipeline, set the active configuration and call targets::tar_make():
library(here)
source(here::here("R/___setup_project___.R"))
# Choose one of the named configurations:
# "project_cz", "project_temporal_europe", "project_temporal_america",
# "project_temporal_asia", "project_spatial_continental",
# "project_spatial_regional", "project_spatial_local"
Sys.setenv(R_CONFIG_ACTIVE = "project_cz")
targets::tar_make()To check which targets are out-of-date before running:
targets::tar_outdated()To visualise the full pipeline dependency graph:
targets::tar_visnetwork()Spatial analyses
Spatial analyses iterate over all geographic units defined in Data/Input/spatial_grid.csv at the selected scale. Use the convenience runner scripts: