* using log directory 'd:/Rcompile/CRANpkg/local/4.4/ClimaRep.Rcheck' * using R version 4.4.3 (2025-02-28 ucrt) * using platform: x86_64-w64-mingw32 * R was compiled by gcc.exe (GCC) 13.3.0 GNU Fortran (GCC) 13.3.0 * running under: Windows Server 2022 x64 (build 20348) * using session charset: UTF-8 * checking for file 'ClimaRep/DESCRIPTION' ... OK * this is package 'ClimaRep' version '1.0' * package encoding: UTF-8 * checking package namespace information ... OK * checking package dependencies ... OK * checking if this is a source package ... OK * checking if there is a namespace ... OK * checking for hidden files and directories ... OK * checking for portable file names ... OK * checking whether package 'ClimaRep' can be installed ... OK * checking installed package size ... OK * checking package directory ... OK * checking DESCRIPTION meta-information ... OK * checking top-level files ... OK * checking for left-over files ... OK * checking index information ... OK * checking package subdirectories ... OK * checking code files for non-ASCII characters ... OK * checking R files for syntax errors ... OK * checking whether the package can be loaded ... [9s] OK * checking whether the package can be loaded with stated dependencies ... [9s] OK * checking whether the package can be unloaded cleanly ... [10s] OK * checking whether the namespace can be loaded with stated dependencies ... [10s] OK * checking whether the namespace can be unloaded cleanly ... [9s] OK * checking loading without being on the library search path ... [10s] OK * checking use of S3 registration ... OK * checking dependencies in R code ... OK * checking S3 generic/method consistency ... OK * checking replacement functions ... OK * checking foreign function calls ... OK * checking R code for possible problems ... [21s] OK * checking Rd files ... [1s] OK * checking Rd metadata ... OK * checking Rd cross-references ... OK * checking for missing documentation entries ... OK * checking for code/documentation mismatches ... OK * checking Rd \usage sections ... OK * checking Rd contents ... OK * checking for unstated dependencies in examples ... OK * checking examples ... [12s] ERROR Running examples in 'ClimaRep-Ex.R' failed The error most likely occurred in: > ### Name: mh_rep > ### Title: Multivariate climate representativeness analysis > ### Aliases: mh_rep > > ### ** Examples > > library(terra) terra 1.8.86 > library(sf) Linking to GEOS 3.13.0, GDAL 3.10.1, PROJ 9.5.1; sf_use_s2() is TRUE > set.seed(2458) > n_cells <- 100 * 100 > r_clim_present <- terra::rast(ncols = 100, nrows = 100, nlyrs = 7) > values(r_clim_present) <- c( + (terra::rowFromCell(r_clim_present, 1:n_cells) * 0.2 + rnorm(n_cells, 0, 3)), + (terra::rowFromCell(r_clim_present, 1:n_cells) * 0.9 + rnorm(n_cells, 0, 0.2)), + (terra::colFromCell(r_clim_present, 1:n_cells) * 0.15 + rnorm(n_cells, 0, 2.5)), + (terra::colFromCell(r_clim_present, 1:n_cells) + + (terra::rowFromCell(r_clim_present, 1:n_cells)) * 0.1 + rnorm(n_cells, 0, 4)), + (terra::colFromCell(r_clim_present, 1:n_cells) / + (terra::rowFromCell(r_clim_present, 1:n_cells)) * 0.1 + rnorm(n_cells, 0, 4)), + (terra::colFromCell(r_clim_present, 1:n_cells) * + (terra::rowFromCell(r_clim_present, 1:n_cells) + 0.1 + rnorm(n_cells, 0, 4))), + (terra::colFromCell(r_clim_present, 1:n_cells) * + (terra::colFromCell(r_clim_present, 1:n_cells) + 0.1 + rnorm(n_cells, 0, 4))) + ) > names(r_clim_present) <- c("varA", "varB", "varC", "varD", "varE", "varF", "varG") > terra::crs(r_clim_present) <- "EPSG:4326" Warning: PROJ: proj_create_from_database: Cannot find proj.db (GDAL error 1) Warning: [crs<-] Cannot set raster SRS: empty srs > > vif_result <- ClimaRep::vif_filter(r_clim_present, th = 5) Starting iterative VIF filtering process - Removing variable with highest VIF ( 15.55 ): varD - Removing variable with highest VIF ( 7.07 ): varB VIF filtering process completed > print(vif_result$summary) $kept_layers [1] "varA" "varC" "varE" "varF" "varG" $excluded_layers [1] "varD" "varB" $original_correlation_matrix varA varB varC varD varE varF varG varA 1.0000 0.8870 0.0087 0.0938 -0.0745 0.5816 0.0028 varB 0.8870 1.0000 0.0043 0.0997 -0.0769 0.6513 0.0003 varC 0.0087 0.0043 1.0000 0.8523 0.0517 0.5676 0.8341 varD 0.0938 0.0997 0.8523 1.0000 0.0576 0.7077 0.9529 varE -0.0745 -0.0769 0.0517 0.0576 1.0000 -0.0256 0.0653 varF 0.5816 0.6513 0.5676 0.7077 -0.0256 1.0000 0.6305 varG 0.0028 0.0003 0.8341 0.9529 0.0653 0.6305 1.0000 $final_vif_values varA varC varE varF varG 2.2832 3.3473 1.0121 3.8325 4.3545 > r_clim_present_filtered <- vif_result$filtered_raster > hex_grid <- sf::st_sf( + sf::st_make_grid( + sf::st_as_sf( + terra::as.polygons( + terra::ext(r_clim_present_filtered))), + square = FALSE) + ) > sf::st_crs(hex_grid) <- "EPSG:4326" > polygons <- hex_grid[sample(nrow(hex_grid), 2), ] > polygons$name <- c("Pol_A", "Pol_B") > study_area_polygon <- sf::st_as_sf(terra::as.polygons(terra::ext(r_clim_present_filtered))) > sf::st_crs(study_area_polygon) <- "EPSG:4326" > terra::plot(r_clim_present_filtered[[1]]) > terra::plot(polygons, add = TRUE, color = "transparent", lwd = 3) > terra::plot(study_area_polygon, add = TRUE, col = "transparent", lwd = 3, border = "red") > > ClimaRep::mh_rep( + polygon = polygons, + col_name = "name", + climate_variables = r_clim_present_filtered, + study_area = study_area_polygon, + th = 0.95, + dir_output = file.path(tempdir(), "ClimaRep"), + save_raw = TRUE + ) Establishing output file structure Validating and adjusting Coordinate Reference Systems (CRS) Adjusting CRS of climate_variables to match the polygon's system (EPSG:4326). Warning: PROJ: proj_create: no database context specified (GDAL error 1) Warning: PROJ: proj_create_from_database: Cannot find proj.db (GDAL error 1) Warning: PROJ: proj_create: no database context specified (GDAL error 1) Error: [project] cannot get output boundaries for the target crs Execution halted * checking for unstated dependencies in 'tests' ... OK * checking tests ... [13s] ERROR Running 'testthat.R' [13s] Running the tests in 'tests/testthat.R' failed. Complete output: > # This file is part of the standard setup for testthat. > # It is recommended that you do not modify it. > # > # Where should you do additional test configuration? > # Learn more about the roles of various files in: > # * https://r-pkgs.org/testing-design.html#sec-tests-files-overview > # * https://testthat.r-lib.org/articles/special-files.html > > library(testthat) > library(ClimaRep) > > test_check("ClimaRep") terra 1.8.86 Attaching package: 'terra' The following objects are masked from 'package:testthat': compare, describe Linking to GEOS 3.13.0, GDAL 3.10.1, PROJ 9.5.1; sf_use_s2() is TRUE Starting iterative VIF filtering process - Removing variable with highest VIF ( 16.45 ): varD - Removing variable with highest VIF ( 7.26 ): varB VIF filtering process completed Attaching package: 'tidyterra' The following object is masked from 'package:stats': filter Starting iterative VIF filtering process - Removing variable with highest VIF ( 15.55 ): varD - Removing variable with highest VIF ( 7.07 ): varB VIF filtering process completed Establishing output file structure Validating and adjusting Coordinate Reference Systems (CRS) Adjusting CRS of climate_variables to match the polygon's system (EPSG:4326). Saving _problems/test-mh_rep-54.R Starting iterative VIF filtering process - Removing variable with highest VIF ( 15.55 ): varD - Removing variable with highest VIF ( 7.07 ): varB VIF filtering process completed Establishing output file structure Validating and adjusting Coordinate Reference Systems (CRS) Adjusting CRS of present_climate_variables to match the polygon's system Saving _problems/test-mh_rep_ch-53.R Starting iterative VIF filtering process - Removing variable with highest VIF ( 15.55 ): varD - Removing variable with highest VIF ( 7.07 ): varB VIF filtering process completed Establishing output file structure Validating and adjusting Coordinate Reference Systems (CRS) Adjusting CRS of present_climate_variables to match the polygon's system Saving _problems/test-rep_overlay-50.R [ FAIL 3 | WARN 17 | SKIP 0 | PASS 4 ] ══ Failed tests ════════════════════════════════════════════════════════════════ ── Error ('test-mh_rep.R:46:3'): mh_present runs and writes output ───────────── Error: [project] cannot get output boundaries for the target crs Backtrace: ▆ 1. └─ClimaRep::mh_rep(...) at test-mh_rep.R:46:3 2. ├─terra::project(climate_variables, reference_system) 3. └─terra::project(climate_variables, reference_system) 4. └─terra (local) .local(x, ...) 5. └─terra:::messages(x, "project") 6. └─terra:::error(f, x@pntr$getError()) ── Error ('test-mh_rep_ch.R:43:3'): mh_rep_ch works correctly ────────────────── Error: [project] cannot get output boundaries for the target crs Backtrace: ▆ 1. └─ClimaRep::mh_rep_ch(...) at test-mh_rep_ch.R:43:3 2. ├─terra::project(present_climate_variables, reference_system) 3. └─terra::project(present_climate_variables, reference_system) 4. └─terra (local) .local(x, ...) 5. └─terra:::messages(x, "project") 6. └─terra:::error(f, x@pntr$getError()) ── Error ('test-rep_overlay.R:40:3'): rep_overlay works correctly ────────────── Error: [project] cannot get output boundaries for the target crs Backtrace: ▆ 1. └─ClimaRep::mh_rep_ch(...) at test-rep_overlay.R:40:3 2. ├─terra::project(present_climate_variables, reference_system) 3. └─terra::project(present_climate_variables, reference_system) 4. └─terra (local) .local(x, ...) 5. └─terra:::messages(x, "project") 6. └─terra:::error(f, x@pntr$getError()) [ FAIL 3 | WARN 17 | SKIP 0 | PASS 4 ] Error: ! Test failures. Execution halted * checking PDF version of manual ... [18s] OK * checking HTML version of manual ... [2s] OK * DONE Status: 2 ERRORs