Running ‘testthat.R’ [49s/50s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > library(testthat)
  > library(CAST)
  > 
  > test_check("CAST")
  Loading required package: ggplot2
  Loading required package: lattice
  note: variables were not weighted either because no weights or model were given,
      no variable importance could be retrieved from the given model, or the model has a single feature.
      Check caret::varImp(model)
  note: No model and no CV folds were given. The DI threshold is therefore based on all training data
  note: variables were not weighted either because no weights or model were given,
      no variable importance could be retrieved from the given model, or the model has a single feature.
      Check caret::varImp(model)
  note: No model and no CV folds were given. The DI threshold is therefore based on all training data
  DI:
  class       : SpatRaster
  size        : 58, 101, 1  (nrow, ncol, nlyr)
  resolution  : 10, 10  (x, y)
  extent      : 493179, 494189, 5180552, 5181132  (xmin, xmax, ymin, ymax)
  coord. ref. : NAD83 / UTM zone 11N (EPSG:26911)
  source(s)   : memory
  varname     : predictors_2012-03-25
  name        :       DI
  min value   :        0
  max value   : 4.448467
  AOA:
  class       : SpatRaster
  size        : 58, 101, 1  (nrow, ncol, nlyr)
  resolution  : 10, 10  (x, y)
  extent      : 493179, 494189, 5180552, 5181132  (xmin, xmax, ymin, ymax)
  coord. ref. : NAD83 / UTM zone 11N (EPSG:26911)
  source(s)   : memory
  varname     : predictors_2012-03-25
  name        : AOA
  min value   :   0
  max value   :   1
  
  
  Predictor Weights:
         DEM      TWI NDRE.Sd
  1 1.279708 8.469273 4.22456
  
  
  AOA Threshold: 0.3898564DI:
  class       : SpatRaster
  size        : 58, 101, 1  (nrow, ncol, nlyr)
  resolution  : 10, 10  (x, y)
  extent      : 493179, 494189, 5180552, 5181132  (xmin, xmax, ymin, ymax)
  coord. ref. : NAD83 / UTM zone 11N (EPSG:26911)
  source(s)   : memory
  varname     : predictors_2012-03-25
  name        :       DI
  min value   :        0
  max value   : 4.448467
  AOA:
  class       : SpatRaster
  size        : 58, 101, 1  (nrow, ncol, nlyr)
  resolution  : 10, 10  (x, y)
  extent      : 493179, 494189, 5180552, 5181132  (xmin, xmax, ymin, ymax)
  coord. ref. : NAD83 / UTM zone 11N (EPSG:26911)
  source(s)   : memory
  varname     : predictors_2012-03-25
  name        : AOA
  min value   :   0
  max value   :   1
  
  
  Predictor Weights:
         DEM      TWI NDRE.Sd
  1 1.279708 8.469273 4.22456
  
  
  AOA Threshold: 0.3898564Saving _problems/test-bss-14.R
  Saving _problems/test-bss-17.R
  [1] "model using Sepal.Length,Sepal.Width will be trained now..."
  note: only 1 unique complexity parameters in default grid. Truncating the grid to 1 .
  
  [1] "maximum number of models that still need to be trained: 8"
  [1] "model using Sepal.Length,Petal.Length will be trained now..."
  note: only 1 unique complexity parameters in default grid. Truncating the grid to 1 .
  
  [1] "maximum number of models that still need to be trained: 7"
  [1] "model using Sepal.Length,Petal.Width will be trained now..."
  note: only 1 unique complexity parameters in default grid. Truncating the grid to 1 .
  
  [1] "maximum number of models that still need to be trained: 6"
  [1] "model using Sepal.Width,Petal.Length will be trained now..."
  note: only 1 unique complexity parameters in default grid. Truncating the grid to 1 .
  
  [1] "maximum number of models that still need to be trained: 5"
  [1] "model using Sepal.Width,Petal.Width will be trained now..."
  note: only 1 unique complexity parameters in default grid. Truncating the grid to 1 .
  
  [1] "maximum number of models that still need to be trained: 4"
  [1] "model using Petal.Length,Petal.Width will be trained now..."
  note: only 1 unique complexity parameters in default grid. Truncating the grid to 1 .
  
  [1] "maximum number of models that still need to be trained: 3"
  [1] "vars selected: Petal.Length,Petal.Width with Accuracy 0.954"
  [1] "model using additional variable Sepal.Length will be trained now..."
  note: only 2 unique complexity parameters in default grid. Truncating the grid to 2 .
  
  [1] "maximum number of models that still need to be trained: 2"
  [1] "model using additional variable Sepal.Width will be trained now..."
  note: only 2 unique complexity parameters in default grid. Truncating the grid to 2 .
  
  [1] "maximum number of models that still need to be trained: 1"
  [1] "vars selected: Petal.Length,Petal.Width,Sepal.Width with Accuracy 0.955"
  [1] "model using additional variable Sepal.Length will be trained now..."
  [1] "maximum number of models that still need to be trained: 0"
  [1] "vars selected: Petal.Length,Petal.Width,Sepal.Width with Accuracy 0.955"
  Sampling 2000 prediction locations from the modeldomain raster.
  Sampling 2000 prediction locations from the modeldomain vector.
  Sampling 2000 prediction locations from the modeldomain vector.
  Sampling 2000 prediction locations from the modeldomain raster.
  Sampling 2000 prediction locations from the modeldomain raster.
  Extracting predictors from modeldomain
  samplesize for new data shouldn't be larger than number of pixels.
                Samplesize was reduced to 100
  Sampling 100 prediction locations from the modeldomain raster.
  samplesize for new data shouldn't be larger than number of pixels.
                Samplesize was reduced to 100
  Sampling 100 prediction locations from the modeldomain raster.
  Extracting predictors from modeldomain
  samplesize for new data shouldn't be larger than number of pixels.
                Samplesize was reduced to 100
  Sampling 100 prediction locations from the modeldomain raster.
  Extracting predictors from modeldomain
  Sampling 2000 prediction locations from the modeldomain vector.
  samplesize for new data shouldn't be larger than number of pixels.
                Samplesize was reduced to 100
  Sampling 100 prediction locations from the modeldomain raster.
  Extracting predictors from modeldomain
  Sampling 2000 prediction locations from the modeldomain raster.
  time variable selected: Date
  time variable selected: Date
  time variable selected: Date
  Sampling 2000 prediction locations from the modeldomain raster.
  note: only 2 unique complexity parameters in default grid. Truncating the grid to 2 .
  
  note: only 2 unique complexity parameters in default grid. Truncating the grid to 2 .
  
  although coordinates are longitude/latitude, st_sample assumes that they are
  planar
  1000 prediction points are sampled from the modeldomain
  Gij <= Gj; a random CV assignment is returned
  1000 prediction points are sampled from the modeldomain
  Gij <= Gj; a random CV assignment is returned
  1000 prediction points are sampled from the modeldomain
  predictor values are extracted for prediction points
  Gij <= Gj; a random CV assignment is returned
  1000 prediction points are sampled from the modeldomain
  predictor values are extracted for prediction points
  Gij <= Gj; a random CV assignment is returned
  1000 prediction points are sampled from the modeldomain
  predictor values are extracted for prediction points
  variable(s) 'fct' is (are) treated as categorical variables
  some prediction points contain NAs, which will be removed
  Gij <= Gj; a random CV assignment is returned
  1000 prediction points are sampled from the modeldomain
  predictor values are extracted for prediction points
  variable(s) 'fct' is (are) treated as categorical variables
  1000 prediction points are sampled from the modeldomain
  predictor values are extracted for prediction points
  variable(s) 'fct' is (are) treated as categorical variables
  1000 prediction points are sampled from the modeldomain
  predictor values are extracted for prediction points
  1000 prediction points are sampled from the modeldomain
  predictor values are extracted for prediction points
  1000 prediction points are sampled from the modeldomain
  predictor values are extracted for prediction points
  1000 prediction points are sampled from the modeldomain
  predictor values are extracted for prediction points
  knndm object
  Space: 
  Clustering algorithm: kmeans
  Intermediate clusters (q): 4
  W statistic: 1.065
  Number of folds: 2
  Observations in each fold:  4 2 
  knndm object
  Space: 
  Clustering algorithm: kmeans
  Intermediate clusters (q): 4
  W statistic: 1.065
  Number of folds: 2
  Observations in each fold:  4 2 
  1000 prediction points are sampled from the modeldomain
  1000 prediction points are sampled from the modeldomain
  1000 prediction points are sampled from the modeldomain
  1000 prediction points are sampled from the modeldomain
  1000 prediction points are sampled from the modeldomain
  predictor values are extracted for prediction points
  1000 prediction points are sampled from the modeldomain
  nndm object
  Total number of points: 10
  Mean number of training points: 8.8
  Minimum number of training points: 8
  nndm object
  Total number of points: 10
  Mean number of training points: 8.8
  Minimum number of training points: 8
  No trainDI provided.
  Computing DI of training data...
  
    |                                                                            
    |                                                                      |   0%
    |                                                                            
    |==                                                                    |   3%
    |                                                                            
    |=====                                                                 |   7%
    |                                                                            
    |=======                                                               |  10%
    |                                                                            
    |=========                                                             |  13%
    |                                                                            
    |============                                                          |  17%
    |                                                                            
    |==============                                                        |  20%
    |                                                                            
    |================                                                      |  23%
    |                                                                            
    |===================                                                   |  27%
    |                                                                            
    |=====================                                                 |  30%
    |                                                                            
    |=======================                                               |  33%
    |                                                                            
    |==========================                                            |  37%
    |                                                                            
    |============================                                          |  40%
    |                                                                            
    |==============================                                        |  43%
    |                                                                            
    |=================================                                     |  47%
    |                                                                            
    |===================================                                   |  50%
    |                                                                            
    |=====================================                                 |  53%
    |                                                                            
    |========================================                              |  57%
    |                                                                            
    |==========================================                            |  60%
    |                                                                            
    |============================================                          |  63%
    |                                                                            
    |===============================================                       |  67%
    |                                                                            
    |=================================================                     |  70%
    |                                                                            
    |===================================================                   |  73%
    |                                                                            
    |======================================================                |  77%
    |                                                                            
    |========================================================              |  80%
    |                                                                            
    |==========================================================            |  83%
    |                                                                            
    |=============================================================         |  87%
    |                                                                            
    |===============================================================       |  90%
    |                                                                            
    |=================================================================     |  93%
    |                                                                            
    |====================================================================  |  97%
    |                                                                            
    |======================================================================| 100%
  Computing DI of new data...
  Computing AOA...
  Finished!
  DI of 30 observation 
  Predictors: DEM TWI NDRE.Sd 
  
  AOA Threshold: 0.3898564DI of 30 observation 
  Predictors: DEM TWI NDRE.Sd 
  
  AOA Threshold: 0.3898564[ FAIL 2 | WARN 0 | SKIP 20 | PASS 144 ]
  
  ══ Skipped tests (20) ══════════════════════════════════════════════════════════
  • On CRAN (20): 'test-aoa.R:124:3', 'test-aoa.R:150:3', 'test-aoa.R:184:3',
    'test-aoa.R:197:3', 'test-errorProfiles.R:3:3', 'test-errorProfiles.R:36:3',
    'test-errorProfiles.R:67:3', 'test-errorProfiles.R:95:3',
    'test-errorProfiles.R:119:3', 'test-fss.R:3:3', 'test-fss.R:27:3',
    'test-fss.R:47:3', 'test-fss.R:70:3', 'test-fss.R:120:5', 'test-fss.R:135:5',
    'test-fss.R:152:5', 'test-fss.R:171:5', 'test-fss.R:192:5',
    'test-fss.R:210:5', 'test-fss.R:232:3'
  
  ══ Failed tests ════════════════════════════════════════════════════════════════
  ── Failure ('test-bss.R:14:3'): bss works with default arguments ───────────────
  Expected `selection$selectedvars` to be identical to `c("bio_1", "bio_4", "bio_5", "bio_6", "bio_8", "bio_12")`.
  Differences:
  `actual`:   "bio_1" "bio_4" "bio_6" "bio_12"                 
  `expected`: "bio_1" "bio_4" "bio_5" "bio_6"  "bio_8" "bio_12"
  
  ── Failure ('test-bss.R:17:3'): bss works with default arguments ───────────────
  Expected `round(selection$results$RMSE, 2)` to be identical to 27.4.
  Differences:
    `actual`: 27.69
  `expected`: 27.40
  
  
  [ FAIL 2 | WARN 0 | SKIP 20 | PASS 144 ]
  Error:
  ! Test failures.
  Execution halted