遇见数据集

R code and datasets to support "Stability and changes of global climate diversity by 2100"

收藏
Zenodo2026-09-30 更新2026-10-01 收录
官方服务:

资源简介:

Climate Diversity Calculation — Code and Data This repository accompanies the manuscript "Stability and changes of global climate diversity by 2100". It provides a reproducible example of the climate diversity (CD) calculation on a focal study region, using the actual 15 standardised bioclimatic variables and seven moving-window sizes. --- 1. System requirements Software dependencies - R (version 4.4.2)- RStudio (2026.08.0, recommended)- R packages (install once): ```rinstall.packages(c("terra"))``` Operating system - Windows 10 (tested). Tested versions - R 4.4.2 on Windows 10 with RStudio 2026.08.0. Non-standard hardware None. A standard desktop or laptop computer is sufficient. 2. Installation guide No installation is required beyond R and the packages above. 1. Download and unzip the archive.2. Open the project in RStudio.3. Set the working directory to the unzipped folder.4. Install missing R packages if prompted: ```rinstall.packages(c("terra"))``` 3. Repository structure upload-zenodo/├── cd-calculate_fast.R ├── cd-calculate-original.R ├── cur-std-clip/ │ ├── cur_bio_1.tif ... cur_bio_17.tif├── cur-result-fast/ │ ├── disc_CUR_mw3.tif│ ├── disc_CUR_mw5.tif│ ├── disc_CUR_mw7.tif│ ├── disc_CUR_mw9.tif│ ├── disc_CUR_mw11.tif│ └── disc_CUR_mw13.tif└── cur-result-original/ ├── disc_CUR_mw3.tif ├── disc_CUR_mw5.tif ├── disc_CUR_mw7.tif ├── disc_CUR_mw9.tif ├── disc_CUR_mw11.tif └── disc_CUR_mw13.tif Folder descriptions - `cur-std-clip/` — The 15 standardised bioclimatic variables (bio1–bio7, bio10–bio17; bio8/9/18/19 are excluded), already clipped to the study area and aligned to a common 5 km grid in the EPSG:6933 equal-area projection. The valid-data mask is derived from the FIRST variable (no separate study-area layer is used by the scripts).- `cur-result-fast/` — Pre-computed climate diversity GeoTIFFs for the current period under seven moving-window sizes (mw = 3, 5, 7, 9, 11, 13 pixels), produced by the SSD fast algorithm.- `cur-result-original/` — Pre-computed climate diversity GeoTIFFs produced by the pair-first original algorithm, used for cross-validation against the fast results.- `cd-calculate_fast.R` — The main script that reads the 15 standardised variables, computes CD for each window size using the SSD fast algorithm, and writes outputs to `cur-result-fast/`.- `cd-calculate-original.R` — An alternative script that computes CD for each window size using the pair-first algorithm (direct pairwise Euclidean distance via `dist()`), and writes outputs to `cur-result-original/`. It uses the same input data (`cur-std-clip/`) and the same valid-data mask as the fast script, so the two scripts are expected to give identical results (up to floating-point error). 4. Demo We provide a ready-to-run example on a focal study region across seven moving-window sizes . Full recomputation Open `cd-calculate_fast.R`.2. Update the file paths and `mw.list` vector at the top of the script.3. Run the script. It reads the 15 variables in `cur-std-clip/`, computes CD for each window size, and writes `disc_CUR_mw*.tif` to `cur-result-fast/`. For the cross-validation of the two algorithms, open `cd-calculate-original.R` and run it; it reads the same 15 variables in `cur-std-clip/` and writes `disc_CUR_mw*.tif` to `cur-result-original/`. The results should match those in `cur-result-fast/` exactly. Expected output - For each window size, a GeoTIFF `disc_CUR_mw*.tif` in `cur-result-fast/` (and, for the original script, in `cur-result-original/`).- Values are non-negative; cells outside the study area are `NA`. Expected run time - Full recomputation for the focal region (seven window sizes): approximately 5–10 minutes on a standard Windows desktop (Intel i7, 32 GB RAM) with the fast algorithm. The pair-first original algorithm is slower and is intended for verification of the fast results. 5. Applying the code to your own data Prepare input layers. Standardise each variable (z-score) before computing CD — the equal-weight Euclidean distance in the formula requires comparable units across variables. Update paths and window sizes. In `cd-calculate_fast.R`, point the input directory to your standardised variables and set `mw.list` as needed (e.g. `c(3, 5, 7, 9, 11, 13)`). Run the script.

提供机构:
Zenodo
创建时间:
2026-09-28
二维码
社区交流群
二维码
科研交流群
商业服务