Running 'rtop.R' [12s]
Running the tests in 'tests/rtop.R' failed.
Complete output:
  > set.seed(1501)
  > #-----------------------------
  > library(rtop)
  Loading required package: sp
  > library(rgdal)
  Please note that rgdal will be retired by the end of 2023,
  plan transition to sf/stars/terra functions using GDAL and PROJ
  at your earliest convenience.
  
  rgdal: version: 1.5-25, (SVN revision 1143)
  Geospatial Data Abstraction Library extensions to R successfully loaded
  Loaded GDAL runtime: GDAL 3.2.1, released 2020/12/29
  Path to GDAL shared files: D:/temp/RtmpwPsxKt/RLIBS_787418ef1442/rgdal/gdal
  GDAL binary built with GEOS: TRUE 
  Loaded PROJ runtime: Rel. 7.2.1, January 1st, 2021, [PJ_VERSION: 721]
  Path to PROJ shared files: D:/temp/RtmpwPsxKt/RLIBS_787418ef1442/rgdal/proj
  PROJ CDN enabled: FALSE
  Linking to sp version:1.4-5
  To mute warnings of possible GDAL/OSR exportToProj4() degradation,
  use options("rgdal_show_exportToProj4_warnings"="none") before loading sp or rgdal.
  Overwritten PROJ_LIB was D:/temp/RtmpwPsxKt/RLIBS_787418ef1442/rgdal/proj
  > if (interactive()) options(error = recover)
  >   # Read directly from shape-files in data directory
  > rpath = system.file("extdata",package="rtop")
  > observations = readOGR(rpath, "observations")
  OGR data source with driver: ESRI Shapefile 
  Source: "D:\temp\RtmpwPsxKt\RLIBS_787418ef1442\rtop\extdata", layer: "observations"
  with 57 features
  It has 7 fields
  Integer64 fields read as strings:  ID EZGID 
  Warning message:
  In OGRSpatialRef(dsn, layer, morphFromESRI = morphFromESRI, dumpSRS = dumpSRS,  :
    Discarded datum D_unknown in Proj4 definition: +proj=lcc +lat_0=47.5 +lon_0=13.3333333333333 +lat_1=46 +lat_2=49 +x_0=400000 +y_0=400000 +ellps=bessel +units=m +no_defs
  > predictionLocations = readOGR(rpath, "predictionLocations")
  OGR data source with driver: ESRI Shapefile 
  Source: "D:\temp\RtmpwPsxKt\RLIBS_787418ef1442\rtop\extdata", layer: "predictionLocations"
  with 235 features
  It has 5 fields
  Integer64 fields read as strings:  ID EZGID 
  Warning message:
  In OGRSpatialRef(dsn, layer, morphFromESRI = morphFromESRI, dumpSRS = dumpSRS,  :
    Discarded datum D_unknown in Proj4 definition: +proj=lcc +lat_0=47.5 +lon_0=13.3333333333333 +lat_1=46 +lat_2=49 +x_0=400000 +y_0=400000 +ellps=bessel +units=m +no_defs
  >   #Finding a few prediction locations of them
  >   
  >   observations = observations[1:30,]
  >   predictionLocations = predictionLocations[1:2,]
  >   
  >   observations$obs = observations$QSUMMER_OB/observations$AREASQKM
  >   
  >   # Setting some parameters 
  >   params = list(gDist = TRUE, cloud = FALSE, rresol = 25, hresol = 3)
  >   # Build an object
  >   rtopObj = createRtopObject(observations,predictionLocations, params = params)
  There were 11 warnings (use warnings() to see them)
  >   # Fit a variogram (function also creates it)
  >   rtopObj = rtopFitVariogram(rtopObj)
  54 best 0.151 function convergence 200 parameter convergence 7004.341 
  87 best 0.151 function convergence 200 parameter convergence 4829.541 
  116 best 0.104 function convergence 200 parameter convergence 4919.598 
  152 best 0.104 function convergence 200 parameter convergence 2320.186 
  183 best 0.101 function convergence 200 parameter convergence 1874.163 
  218 best 0.1 function convergence 40.3 parameter convergence 1506.029 
  258 best 0.0992 function convergence 41.4 parameter convergence 1190.103 
  285 best 0.0988 function convergence 5.11 parameter convergence 857.3599 
  315 best 0.0984 function convergence 5.46 parameter convergence 614.8605 
  348 best 0.0983 function convergence 2.91 parameter convergence 604.5308 
  378 best 0.0983 function convergence 2.11 parameter convergence 409.8584 
  408 best 0.0982 function convergence 0.974 parameter convergence 333.4805 
  434 best 0.0982 function convergence 0.611 parameter convergence 292.7671 
  460 best 0.0982 function convergence 0.276 parameter convergence 249.5959 
  486 best 0.0982 function convergence 0.138 parameter convergence 173.3137 
  511 best 0.0982 function convergence 0.101 parameter convergence 134.1289 
  538 best 0.0982 function convergence 0.0471 parameter convergence 103.7683 
  567 best 0.0982 function convergence 0.0296 parameter convergence 78.45676 
  594 best 0.0982 function convergence 0.0145 parameter convergence 62.52463 
  619 best 0.0982 function convergence 0.0094 parameter convergence 43.92819 
  646 best 0.0982 function convergence 0.00508 parameter convergence 29.9044 
  671 best 0.0982 function convergence 0.00309 parameter convergence 35.68502 
  696 best 0.0982 function convergence 0.00197 parameter convergence 26.74935 
  721 best 0.0982 function convergence 0.0013 parameter convergence 26.15482 
  746 best 0.0982 function convergence 0.000629 parameter convergence 21.97552 
  775 best 0.0982 function convergence 0.000437 parameter convergence 15.39891 
  800 best 0.0982 function convergence 0.000289 parameter convergence 12.10966 
  825 best 0.0982 function convergence 0.000172 parameter convergence 7.597694 
  850 best 0.0982 function convergence 0.000118 parameter convergence 6.702412 
  875 best 0.0982 function convergence 7.81e-05 parameter convergence 5.394488 
  900 best 0.0982 function convergence 4.62e-05 parameter convergence 4.999338 
  925 best 0.0982 function convergence 2.7e-05 parameter convergence 4.668345 
  950 best 0.0982 function convergence 1.7e-05 parameter convergence 5.130327 
  975 best 0.0982 function convergence 1.45e-05 parameter convergence 3.504084 
  1000 best 0.0982 function convergence 6.61e-06 parameter convergence 2.521724 
  1025 best 0.0982 function convergence 4.18e-06 parameter convergence 1.742588 
  1052 best 0.0982 function convergence 2.91e-06 parameter convergence 1.725401 
  1079 best 0.0982 function convergence 1.55e-06 parameter convergence 1.32487 
  1104 best 0.0982 function convergence 9.41e-07 parameter convergence 1.048603 
  1129 best 0.0982 function convergence 7.99e-07 parameter convergence 0.9904745 
  >   #rtopObj = checkVario(rtopObj)
  >   rtopObj$variogramModel                                                                        
  $model
  [1] "Ex1"
  
  $params
  [1] 1.932677e-04 4.206564e+05 0.000000e+00 1.835981e-02 8.979182e-01
  
  attr(,"class")
  [1] "rtopVariogramModel"
  attr(,"SSErr")
  [1] 0.549524
  attr(,"criterion")
  [1] 0.09816154
  >   rtopObj2 = rtopKrige(rtopObj, cv = TRUE)
  [1] "Sampling points from  30 areas"
  [1] "Sampled on average 54.2 points from 30 areas"
  [1] "cross-validating 30 areas"
  > 
  > 
  >   print(attr(rtopObj2$varMatObs,"variogramModel"))
  $model
  [1] "Ex1"
  
  $params
  [1] 1.932677e-04 4.206564e+05 0.000000e+00 1.835981e-02 8.979182e-01
  
  attr(,"class")
  [1] "rtopVariogramModel"
  attr(,"SSErr")
  [1] 0.549524
  attr(,"criterion")
  [1] 0.09816154
  >   
  >   rtopObj3 = rtopKrige(rtopObj)
  [1] "Sampling points from  30 areas"
  [1] "Sampled on average 54.2 points from 30 areas"
  [1] "Sampling points from  2 areas"
  [1] "Sampled on average 77 points from 2 areas"
  [1] "Creating prediction semivariance matrix. This can take some time."
  [1] "interpolating  2 areas"
  > 
  > 
  >  varmat = varMat(observations, predictionLocations, variogramModel = rtopObj$variogramModel, 
  +                  gDistEst = TRUE, gDistPred = TRUE, rresol = 25, hresol = 3)
  [1] "Sampling points from  30 areas"
  [1] "Sampled on average 54.2 points from 30 areas"
  [1] "Sampling points from  2 areas"
  [1] "Sampled on average 77 points from 2 areas"
  > 
  > all.equal(varmat$varMatObs, rtopObj2$varMatObs)
  [1] TRUE
  > rtopObj4 = rtopKrige(rtopObj2)
  [1] "Sampling points from  2 areas"
  [1] "Sampled on average 77 points from 2 areas"
  [1] "Creating prediction semivariance matrix. This can take some time."
  [1] "interpolating  2 areas"
  > 
  > #debug(rtop:::rtopDisc.SpatialPolygons)
  > #  rtopObj5 = rtopKrige(rtopObj, params = list(cnAreas = 5, cDlim = 10, nclus = 2))
  >   
  >   print(summary(rtopObj2$predictions))
  Object of class SpatialPolygonsDataFrame
  Coordinates:
         min      max
  x 398053.6 511323.9
  y 454983.1 541508.8
  Is projected: TRUE 
  proj4string :
  [+proj=lcc +lat_0=47.5 +lon_0=13.3333333333333 +lat_1=46 +lat_2=49
  +x_0=400000 +y_0=400000 +ellps=bessel +units=m +no_defs]
  Data attributes:
        ID               EZGID              AREASQKM         XSTATION     
   Length:30          Length:30          Min.   : 13.64   Min.   :400882  
   Class :character   Class :character   1st Qu.: 26.47   1st Qu.:421621  
   Mode  :character   Mode  :character   Median : 51.14   Median :433238  
                                         Mean   : 48.57   Mean   :442177  
                                         3rd Qu.: 62.12   3rd Qu.:466139  
                                         Max.   :127.90   Max.   :507123  
      YSTATION        QSUMMER_OB          obs                area          
   Min.   :458036   Min.   :0.1415   Min.   :0.005397   Min.   : 13643136  
   1st Qu.:475353   1st Qu.:0.3305   1st Qu.:0.009116   1st Qu.: 26471133  
   Median :487692   Median :0.4789   Median :0.011203   Median : 51143819  
   Mean   :489633   Mean   :0.5283   Mean   :0.011727   Mean   : 48574940  
   3rd Qu.:500377   3rd Qu.:0.6475   3rd Qu.:0.012502   3rd Qu.: 62123200  
   Max.   :535299   Max.   :1.3004   Max.   :0.030287   Max.   :127900610  
     var1.pred           var1.var           sumWeights       observed       
   Min.   :0.006822   Min.   :6.696e-07   Min.   :1.298   Min.   :0.005397  
   1st Qu.:0.009474   1st Qu.:2.080e-06   1st Qu.:1.485   1st Qu.:0.009116  
   Median :0.010734   Median :4.147e-06   Median :1.491   Median :0.011203  
   Mean   :0.011426   Mean   :5.531e-06   Mean   :1.471   Mean   :0.011727  
   3rd Qu.:0.011459   3rd Qu.:7.392e-06   3rd Qu.:1.494   3rd Qu.:0.012502  
   Max.   :0.021935   Max.   :2.048e-05   Max.   :1.499   Max.   :0.030287  
      residual              zscore        
   Min.   :-0.0135800   Min.   :-4.77426  
   1st Qu.:-0.0022475   1st Qu.:-1.24036  
   Median : 0.0001632   Median : 0.14663  
   Mean   : 0.0003007   Mean   : 0.04667  
   3rd Qu.: 0.0017430   3rd Qu.: 1.00713  
   Max.   : 0.0212632   Max.   : 5.67251  
  >   print(summary(rtopObj3$predictions))
  Object of class SpatialPolygonsDataFrame
  Coordinates:
         min      max
  x 488653.9 498292.5
  y 515726.4 528863.7
  Is projected: TRUE 
  proj4string :
  [+proj=lcc +lat_0=47.5 +lon_0=13.3333333333333 +lat_1=46 +lat_2=49
  +x_0=400000 +y_0=400000 +ellps=bessel +units=m +no_defs]
  Data attributes:
        ID               EZGID              AREASQKM        XSTATION     
   Length:2           Length:2           Min.   :35.98   Min.   :490602  
   Class :character   Class :character   1st Qu.:36.61   1st Qu.:490602  
   Mode  :character   Mode  :character   Median :37.23   Median :490602  
                                         Mean   :37.23   Mean   :490602  
                                         3rd Qu.:37.86   3rd Qu.:490602  
                                         Max.   :38.49   Max.   :490602  
      YSTATION           area            var1.pred          var1.var        
   Min.   :523496   Min.   :35982138   Min.   :0.01121   Min.   :9.224e-07  
   1st Qu.:523496   1st Qu.:36608367   1st Qu.:0.01144   1st Qu.:1.297e-06  
   Median :523496   Median :37234596   Median :0.01168   Median :1.671e-06  
   Mean   :523496   Mean   :37234596   Mean   :0.01168   Mean   :1.671e-06  
   3rd Qu.:523496   3rd Qu.:37860825   3rd Qu.:0.01191   3rd Qu.:2.045e-06  
   Max.   :523496   Max.   :38487054   Max.   :0.01215   Max.   :2.419e-06  
     sumWeights   
   Min.   :1.183  
   1st Qu.:1.261  
   Median :1.339  
   Mean   :1.339  
   3rd Qu.:1.417  
   Max.   :1.494  
  >   print(summary(rtopObj4$predictions))
  Object of class SpatialPolygonsDataFrame
  Coordinates:
         min      max
  x 488653.9 498292.5
  y 515726.4 528863.7
  Is projected: TRUE 
  proj4string :
  [+proj=lcc +lat_0=47.5 +lon_0=13.3333333333333 +lat_1=46 +lat_2=49
  +x_0=400000 +y_0=400000 +ellps=bessel +units=m +no_defs]
  Data attributes:
        ID               EZGID              AREASQKM        XSTATION     
   Length:2           Length:2           Min.   :35.98   Min.   :490602  
   Class :character   Class :character   1st Qu.:36.61   1st Qu.:490602  
   Mode  :character   Mode  :character   Median :37.23   Median :490602  
                                         Mean   :37.23   Mean   :490602  
                                         3rd Qu.:37.86   3rd Qu.:490602  
                                         Max.   :38.49   Max.   :490602  
      YSTATION           area            var1.pred          var1.var        
   Min.   :523496   Min.   :35982138   Min.   :0.01121   Min.   :9.224e-07  
   1st Qu.:523496   1st Qu.:36608367   1st Qu.:0.01144   1st Qu.:1.297e-06  
   Median :523496   Median :37234596   Median :0.01168   Median :1.671e-06  
   Mean   :523496   Mean   :37234596   Mean   :0.01168   Mean   :1.671e-06  
   3rd Qu.:523496   3rd Qu.:37860825   3rd Qu.:0.01191   3rd Qu.:2.045e-06  
   Max.   :523496   Max.   :38487054   Max.   :0.01215   Max.   :2.419e-06  
     sumWeights   
   Min.   :1.183  
   1st Qu.:1.261  
   Median :1.339  
   Mean   :1.339  
   3rd Qu.:1.417  
   Max.   :1.494  
  >   print(all.equal(rtopObj4$predictions, rtopObj3$predictions))
  [1] TRUE
  >   #spplot(rtopObj$predictions,col.regions = bpy.colors(), c("var1.pred","var1.var"))
  >   
  >   # Cross-validation
  >   #spplot(rtopObj2$predictions,col.regions = bpy.colors(), c("observed","var1.pred"))
  >   print(cor(rtopObj2$predictions$observed,rtopObj2$predictions$var1.pred))
  [1] 0.1680755
  >   
  > 
  > 
  > 
  >   set.seed(1501)
  >   library(intamap)
  Error: package or namespace load failed for 'intamap' in library.dynam(lib, package, package.lib):
   DLL 'Rcpp' not found: maybe not installed for this architecture?
  Execution halted