@@ -48,10 +48,10 @@ test_that("AOA works in default: used with raster data and a trained model", {
4848 0.23604264 , 0.20388725 , 0.91513568 , 0.09558666 , 0.14046341 ,
4949 0.16214832 , 0.37107762 , 0.16214832 , 0.18471625 , 0.12344463 ))
5050 # test summary statistics of the DI
51- expect_equal(as.vector(summary(terra :: values(AOA $ DI ))),
51+ expect_equal(as.vector(summary(terra :: values(AOA $ DI )))[ 1 : 6 ] ,
5252 c(" Min. :0.0000 " , " 1st Qu.:0.1329 " , " Median :0.2052 " ,
5353 " Mean :0.2858 " , " 3rd Qu.:0.3815 " ,
54- " Max. :4.4485 " , " NA's :1993 " ))
54+ " Max. :4.4485 " ))
5555})
5656
5757
@@ -65,10 +65,10 @@ test_that("AOA works without a trained model", {
6565 # test number of pixels within AOA:
6666 expect_equal(sum(terra :: values(AOA $ AOA )== 1 ,na.rm = TRUE ), 3377 )
6767 # test summary statistics of the DI
68- expect_equal(as.vector(summary(terra :: values(AOA $ DI ))),
68+ expect_equal(as.vector(summary(terra :: values(AOA $ DI )))[ 1 : 6 ] ,
6969 c(" Min. :0.0000 " , " 1st Qu.:0.1759 " , " Median :0.2642 " ,
7070 " Mean :0.3109 " , " 3rd Qu.:0.4051 " ,
71- " Max. :2.6631 " , " NA's :1993 " ))
71+ " Max. :2.6631 " ))
7272})
7373
7474test_that(" AOA (including LPD) works with raster data and a trained model" , {
@@ -89,10 +89,10 @@ test_that("AOA (including LPD) works with raster data and a trained model", {
8989 3 , 4 , 0 , 2 , 3 ,
9090 6 , 1 , 7 , 3 , 2 ))
9191 # test summary statistics of the DI
92- expect_equal(as.vector(summary(terra :: values(AOA $ DI ))),
92+ expect_equal(as.vector(summary(terra :: values(AOA $ DI )))[ 1 : 6 ] ,
9393 c(" Min. :0.0000 " , " 1st Qu.:0.1329 " , " Median :0.2052 " ,
9494 " Mean :0.2858 " , " 3rd Qu.:0.3815 " ,
95- " Max. :4.4485 " , " NA's :1993 " ))
95+ " Max. :4.4485 " ))
9696})
9797
9898
@@ -113,10 +113,10 @@ test_that("AOA (inluding LPD) works without a trained model", {
113113 6 , 5 , 0 , 5 , 9 ,
114114 8 , 4 , 11 , 3 ,2 ))
115115 # test summary statistics of the DI
116- expect_equal(as.vector(summary(terra :: values(AOA $ DI ))),
116+ expect_equal(as.vector(summary(terra :: values(AOA $ DI )))[ 1 : 6 ] ,
117117 c(" Min. :0.0000 " , " 1st Qu.:0.1759 " , " Median :0.2642 " ,
118118 " Mean :0.3109 " , " 3rd Qu.:0.4051 " ,
119- " Max. :2.6631 " , " NA's :1993 " ))
119+ " Max. :2.6631 " ))
120120})
121121
122122
@@ -138,10 +138,10 @@ test_that("AOA (including LPD) works in parallel with raster data and a trained
138138 3 , 4 , 0 , 2 , 3 ,
139139 6 , 1 , 7 , 3 , 2 ))
140140 # test summary statistics of the DI
141- expect_equal(as.vector(summary(terra :: values(AOA $ DI ))),
141+ expect_equal(as.vector(summary(terra :: values(AOA $ DI )))[ 1 : 6 ] ,
142142 c(" Min. :0.0000 " , " 1st Qu.:0.1329 " , " Median :0.2052 " ,
143143 " Mean :0.2858 " , " 3rd Qu.:0.3815 " ,
144- " Max. :4.4485 " , " NA's :1993 " ))
144+ " Max. :4.4485 " ))
145145})
146146
147147
@@ -162,8 +162,8 @@ test_that("AOA (inluding LPD) works in parallel without a trained model", {
162162 6 , 5 , 0 , 5 , 9 ,
163163 8 , 4 , 11 , 3 ,2 ))
164164 # test summary statistics of the DI
165- expect_equal(as.vector(summary(terra :: values(AOA $ DI ))),
165+ expect_equal(as.vector(summary(terra :: values(AOA $ DI )))[ 1 : 6 ] ,
166166 c(" Min. :0.0000 " , " 1st Qu.:0.1759 " , " Median :0.2642 " ,
167167 " Mean :0.3109 " , " 3rd Qu.:0.4051 " ,
168- " Max. :2.6631 " , " NA's :1993 " ))
168+ " Max. :2.6631 " ))
169169})
0 commit comments