Running ‘allier.R’
  Comparing ‘allier.Rout’ to ‘allier.Rout.save’ ... OK
  Running ‘blockkr.R’
  Comparing ‘blockkr.Rout’ to ‘blockkr.Rout.save’ ... OK
  Running ‘covtable.R’
  Comparing ‘covtable.Rout’ to ‘covtable.Rout.save’ ... OK
  Running ‘cv.R’
  Comparing ‘cv.Rout’ to ‘cv.Rout.save’ ... OK
  Running ‘cv3d.R’
  Comparing ‘cv3d.Rout’ to ‘cv3d.Rout.save’ ... OK
  Running ‘fit.R’
  Comparing ‘fit.Rout’ to ‘fit.Rout.save’ ... OK
  Running ‘krige0.R’
  Comparing ‘krige0.Rout’ to ‘krige0.Rout.save’ ... OK
  Running ‘line.R’
  Comparing ‘line.Rout’ to ‘line.Rout.save’ ... OK
  Running ‘merge.R’
  Comparing ‘merge.Rout’ to ‘merge.Rout.save’ ... OK
  Running ‘na.action.R’
  Comparing ‘na.action.Rout’ to ‘na.action.Rout.save’ ... OK
  Running ‘rings.R’
  Comparing ‘rings.Rout’ to ‘rings.Rout.save’ ... OK
  Running ‘sim.R’
  Comparing ‘sim.Rout’ to ‘sim.Rout.save’ ... OK
  Running ‘stars.R’
  Running ‘unproj.R’
  Comparing ‘unproj.Rout’ to ‘unproj.Rout.save’ ...13,15d12
< Warning message:
< In showSRID(uprojargs, format = "PROJ", multiline = "NO") :
<   Discarded datum Amersfoort in CRS definition
18,20d14
< Warning message:
< In showSRID(uprojargs, format = "PROJ", multiline = "NO") :
<   Discarded datum Unknown based on WGS84 ellipsoid in CRS definition
91,93d84
< Warning message:
< In showSRID(uprojargs, format = "PROJ", multiline = "NO") :
<   Discarded datum Unknown based on WGS84 ellipsoid in CRS definition
  Running ‘variogram.R’
  Comparing ‘variogram.Rout’ to ‘variogram.Rout.save’ ... OK
  Running ‘vdist.R’
  Comparing ‘vdist.Rout’ to ‘vdist.Rout.save’ ... OK
  Running ‘windst.R’ [12s/12s]
  Comparing ‘windst.Rout’ to ‘windst.Rout.save’ ...46,47d45
< Warning message:
< In proj4string(m) : CRS object has comment, which is lost in output
67,71d64
< Warning messages:
< 1: In proj4string(obj@sp) :
<   CRS object has comment, which is lost in output
< 2: In proj4string(obj@sp) :
<   CRS object has comment, which is lost in output
81,86c74,75
< Warning messages:
< 1: In proj4string(data@sp) :
<   CRS object has comment, which is lost in output
< 2: In proj4string(newdata@sp) :
<   CRS object has comment, which is lost in output
< 3: In krigeST(sqrt(values) ~ 1, w, STF(grd, tgrd), v) :
---
> Warning message:
> In krigeST(sqrt(values) ~ 1, w, STF(grd, tgrd), v) :
99,108c88,89
< Warning messages:
< 1: In sp::proj4string(.x@sp) :
<   CRS object has comment, which is lost in output
< 2: In sp::proj4string(.x@sp) :
<   CRS object has comment, which is lost in output
< 3: In proj4string(data@sp) :
<   CRS object has comment, which is lost in output
< 4: In proj4string(newdata@sp) :
<   CRS object has comment, which is lost in output
< 5: In krigeST(sqrt(values) ~ 1, st_as_stars(w), st_as_stars(newd),  :
---
> Warning message:
> In krigeST(sqrt(values) ~ 1, st_as_stars(w), st_as_stars(newd),  :
111,112d91
< 6: In sp::proj4string(.x@sp) :
<   CRS object has comment, which is lost in output
115,116d93
< Warning message:
< In sp::proj4string(.x@sp) : CRS object has comment, which is lost in output
126,127d102
< Warning message:
< In sp::proj4string(.x@sp) : CRS object has comment, which is lost in output
142,143d116
< Warning message:
< In sp::proj4string(.x@sp) : CRS object has comment, which is lost in output
147,148d119
< Warning message:
< In sp::proj4string(.x@sp) : CRS object has comment, which is lost in output
158,159d128
< Warning message:
< In sp::proj4string(.x@sp) : CRS object has comment, which is lost in output
Running the tests in ‘tests/stars.R’ failed.
Complete output:
  > # 0. using sp:
  > 
  > suppressPackageStartupMessages(library(sp))
  > demo(meuse, ask = FALSE)
  
  
  	demo(meuse)
  	---- ~~~~~
  
  > require(sp)
  
  > crs = CRS("+init=epsg:28992")
  
  > data("meuse")
  
  > coordinates(meuse) <- ~x+y
  
  > proj4string(meuse) <- crs
  
  > data("meuse.grid")
  
  > coordinates(meuse.grid) <- ~x+y
  
  > gridded(meuse.grid) <- TRUE
  
  > proj4string(meuse.grid) <- crs
  
  > data("meuse.riv")
  
  > meuse.riv <- SpatialPolygons(list(Polygons(list(Polygon(meuse.riv)),"meuse.riv")))
  
  > proj4string(meuse.riv) <- crs
  
  > data("meuse.area")
  
  > meuse.area = SpatialPolygons(list(Polygons(list(Polygon(meuse.area)), "area")))
  
  > proj4string(meuse.area) <- crs
  Warning message:
  In showSRID(uprojargs, format = "PROJ", multiline = "NO") :
    Discarded datum Amersfoort in CRS definition
  > suppressPackageStartupMessages(library(gstat))
  > v = variogram(log(zinc)~1, meuse)
  > (v.fit = fit.variogram(v, vgm(1, "Sph", 900, 1)))
    model      psill    range
  1   Nug 0.05066243   0.0000
  2   Sph 0.59060780 897.0209
  > k_sp = krige(log(zinc)~1, meuse[-(1:5),], meuse[1:5,], v.fit)
  [using ordinary kriging]
  Warning messages:
  1: In proj4string(d$data) :
    CRS object has comment, which is lost in output
  2: In proj4string(newdata) :
    CRS object has comment, which is lost in output
  3: In proj4string(newdata) :
    CRS object has comment, which is lost in output
  4: In showSRID(uprojargs, format = "PROJ", multiline = "NO") :
    Discarded datum Unknown based on Bessel 1841 ellipsoid in CRS definition
  > k_sp_grd = krige(log(zinc)~1, meuse, meuse.grid, v.fit)
  [using ordinary kriging]
  Warning messages:
  1: In proj4string(d$data) :
    CRS object has comment, which is lost in output
  2: In proj4string(newdata) :
    CRS object has comment, which is lost in output
  3: In proj4string(newdata) :
    CRS object has comment, which is lost in output
  4: In showSRID(uprojargs, format = "PROJ", multiline = "NO") :
    Discarded datum Unknown based on Bessel 1841 ellipsoid in CRS definition
  > 
  > # 1. using sf:
  > suppressPackageStartupMessages(library(sf))
  > demo(meuse_sf, ask = FALSE, echo = FALSE)
  > # reloads meuse as data.frame, so
  > demo(meuse, ask = FALSE)
  
  
  	demo(meuse)
  	---- ~~~~~
  
  > require(sp)
  
  > crs = CRS("+init=epsg:28992")
  
  > data("meuse")
  
  > coordinates(meuse) <- ~x+y
  
  > proj4string(meuse) <- crs
  
  > data("meuse.grid")
  
  > coordinates(meuse.grid) <- ~x+y
  
  > gridded(meuse.grid) <- TRUE
  
  > proj4string(meuse.grid) <- crs
  
  > data("meuse.riv")
  
  > meuse.riv <- SpatialPolygons(list(Polygons(list(Polygon(meuse.riv)),"meuse.riv")))
  
  > proj4string(meuse.riv) <- crs
  
  > data("meuse.area")
  
  > meuse.area = SpatialPolygons(list(Polygons(list(Polygon(meuse.area)), "area")))
  
  > proj4string(meuse.area) <- crs
  Warning message:
  In showSRID(uprojargs, format = "PROJ", multiline = "NO") :
    Discarded datum Amersfoort in CRS definition
  > 
  > v = variogram(log(zinc)~1, meuse_sf)
  Warning message:
  In showSRID(uprojargs, format = "PROJ", multiline = "NO") :
    Discarded datum Unknown based on Bessel 1841 ellipsoid in CRS definition,
   but +towgs84= values preserved
  > (v.fit = fit.variogram(v, vgm(1, "Sph", 900, 1)))
    model      psill    range
  1   Nug 0.05066243   0.0000
  2   Sph 0.59060780 897.0209
  > k_sf = krige(log(zinc)~1, meuse_sf[-(1:5),], meuse_sf[1:5,], v.fit)
  [using ordinary kriging]
  > 
  > all.equal(k_sp, as(k_sf, "Spatial"), check.attributes = FALSE)
  [1] TRUE
  Warning message:
  In showSRID(uprojargs, format = "PROJ", multiline = "NO") :
    Discarded datum Unknown based on Bessel 1841 ellipsoid in CRS definition,
   but +towgs84= values preserved
  > all.equal(k_sp, as(k_sf, "Spatial"), check.attributes = TRUE)
  [1] "Attributes: < Component \"bbox\": Attributes: < Component \"dimnames\": Component 1: 2 string mismatches > >"  
  [2] "Attributes: < Component \"coords\": Attributes: < Component \"dimnames\": Component 2: 2 string mismatches > >"
  [3] "Attributes: < Component \"coords.nrs\": Numeric: lengths (2, 0) differ >"                                      
  [4] "Attributes: < Component \"proj4string\": Attributes: < Component \"comment\": 1 string mismatch > >"           
  [5] "Attributes: < Component \"proj4string\": Attributes: < Component \"projargs\": 1 string mismatch > >"          
  Warning message:
  In showSRID(uprojargs, format = "PROJ", multiline = "NO") :
    Discarded datum Unknown based on Bessel 1841 ellipsoid in CRS definition,
   but +towgs84= values preserved
  > 
  > # 2. using stars for grid:
  > 
  > suppressPackageStartupMessages(library(rgdal))
  > writeGDAL(meuse.grid[,"dist"], "meuse.tif", "GTiff")
  > suppressPackageStartupMessages(library(stars))
  > (st0 = setNames(read_stars("meuse.tif"), "dist"))
  stars object with 2 dimensions and 1 attribute
  attribute(s):
       dist       
   Min.   :0.000  
   1st Qu.:0.119  
   Median :0.272  
   Mean   :0.297  
   3rd Qu.:0.440  
   Max.   :0.993  
   NA's   :5009   
  dimension(s):
    from  to offset delta              refsys point values    
  x    1  78 178440    40 Amersfoort / RD New FALSE   NULL [x]
  y    1 104 333760   -40 Amersfoort / RD New FALSE   NULL [y]
  > st = st_as_stars(meuse.grid)
  Warning messages:
  1: In sp::proj4string(.x) :
    CRS object has comment, which is lost in output
  2: In sp::proj4string(.x) :
    CRS object has comment, which is lost in output
  > all.equal(st_dimensions(st0), st_dimensions(st))
   [1] "Component \"x\": Component \"refsys\": Modes: list, character"                              
   [2] "Component \"x\": Component \"refsys\": names for target but not for current"                
   [3] "Component \"x\": Component \"refsys\": Attributes: < Modes: list, NULL >"                   
   [4] "Component \"x\": Component \"refsys\": Attributes: < names for target but not for current >"
   [5] "Component \"x\": Component \"refsys\": Attributes: < current is not list-like >"            
   [6] "Component \"x\": Component \"refsys\": Length mismatch: comparison on first 1 components"   
   [7] "Component \"x\": Component \"refsys\": Component 1: 1 string mismatch"                      
   [8] "Component \"x\": Component \"point\": 'is.NA' value mismatch: 1 in current 0 in target"     
   [9] "Component \"y\": Component \"refsys\": Modes: list, character"                              
  [10] "Component \"y\": Component \"refsys\": names for target but not for current"                
  [11] "Component \"y\": Component \"refsys\": Attributes: < Modes: list, NULL >"                   
  [12] "Component \"y\": Component \"refsys\": Attributes: < names for target but not for current >"
  [13] "Component \"y\": Component \"refsys\": Attributes: < current is not list-like >"            
  [14] "Component \"y\": Component \"refsys\": Length mismatch: comparison on first 1 components"   
  [15] "Component \"y\": Component \"refsys\": Component 1: 1 string mismatch"                      
  [16] "Component \"y\": Component \"point\": 'is.NA' value mismatch: 1 in current 0 in target"     
  > st_crs(st0)
  Coordinate Reference System:
    User input: Amersfoort / RD New 
    wkt:
  PROJCRS["Amersfoort / RD New",
      BASEGEOGCRS["Amersfoort",
          DATUM["Amersfoort",
              ELLIPSOID["Bessel 1841",6377397.155,299.152812800003,
                  LENGTHUNIT["metre",1]]],
          PRIMEM["Greenwich",0,
              ANGLEUNIT["degree",0.0174532925199433]],
          ID["EPSG",4289]],
      CONVERSION["Oblique Stereographic",
          METHOD["Oblique Stereographic",
              ID["EPSG",9809]],
          PARAMETER["Latitude of natural origin",52.1561605555556,
              ANGLEUNIT["degree",0.0174532925199433],
              ID["EPSG",8801]],
          PARAMETER["Longitude of natural origin",5.38763888888889,
              ANGLEUNIT["degree",0.0174532925199433],
              ID["EPSG",8802]],
          PARAMETER["Scale factor at natural origin",0.9999079,
              SCALEUNIT["unity",1],
              ID["EPSG",8805]],
          PARAMETER["False easting",155000,
              LENGTHUNIT["metre",1],
              ID["EPSG",8806]],
          PARAMETER["False northing",463000,
              LENGTHUNIT["metre",1],
              ID["EPSG",8807]]],
      CS[Cartesian,2],
          AXIS["easting",east,
              ORDER[1],
              LENGTHUNIT["metre",1,
                  ID["EPSG",9001]]],
          AXIS["northing",north,
              ORDER[2],
              LENGTHUNIT["metre",1,
                  ID["EPSG",9001]]]]
  > st_crs(st)
  Coordinate Reference System:
    User input: +proj=sterea +lat_0=52.1561605555556 +lon_0=5.38763888888889 +k=0.9999079 +x_0=155000 +y_0=463000 +ellps=bessel +units=m +no_defs 
    wkt:
  PROJCRS["unknown",
      BASEGEOGCRS["unknown",
          DATUM["Unknown based on Bessel 1841 ellipsoid",
              ELLIPSOID["Bessel 1841",6377397.155,299.1528128,
                  LENGTHUNIT["metre",1,
                      ID["EPSG",9001]]]],
          PRIMEM["Greenwich",0,
              ANGLEUNIT["degree",0.0174532925199433],
              ID["EPSG",8901]]],
      CONVERSION["unknown",
          METHOD["Oblique Stereographic",
              ID["EPSG",9809]],
          PARAMETER["Latitude of natural origin",52.1561605555556,
              ANGLEUNIT["degree",0.0174532925199433],
              ID["EPSG",8801]],
          PARAMETER["Longitude of natural origin",5.38763888888889,
              ANGLEUNIT["degree",0.0174532925199433],
              ID["EPSG",8802]],
          PARAMETER["Scale factor at natural origin",0.9999079,
              SCALEUNIT["unity",1],
              ID["EPSG",8805]],
          PARAMETER["False easting",155000,
              LENGTHUNIT["metre",1],
              ID["EPSG",8806]],
          PARAMETER["False northing",463000,
              LENGTHUNIT["metre",1],
              ID["EPSG",8807]]],
      CS[Cartesian,2],
          AXIS["(E)",east,
              ORDER[1],
              LENGTHUNIT["metre",1,
                  ID["EPSG",9001]]],
          AXIS["(N)",north,
              ORDER[2],
              LENGTHUNIT["metre",1,
                  ID["EPSG",9001]]]]
  > 
  > # compare inputs:
  > sp = as(st, "Spatial")
  Warning message:
  In showSRID(uprojargs, format = "PROJ", multiline = "NO") :
    Discarded datum Unknown based on Bessel 1841 ellipsoid in CRS definition
  > fullgrid(meuse.grid) = TRUE
  > all.equal(sp, meuse.grid["dist"], check.attributes = FALSE)
  [1] "Names: Lengths (5, 1) differ (string compare on first 1)"
  [2] "Names: 1 string mismatch"                                
  > all.equal(sp, meuse.grid["dist"], check.attributes = TRUE, use.names = FALSE)
  [1] "Names: Lengths (5, 1) differ (string compare on first 1)"                                      
  [2] "Names: 1 string mismatch"                                                                      
  [3] "Attributes: < Component 3: Names: 1 string mismatch >"                                         
  [4] "Attributes: < Component 3: Length mismatch: comparison on first 1 components >"                
  [5] "Attributes: < Component 3: Component 1: Mean relative difference: 1.08298 >"                   
  [6] "Attributes: < Component 4: Attributes: < Component 2: names for current but not for target > >"
  [7] "Attributes: < Component 4: Attributes: < Component 3: names for current but not for target > >"
  [8] "Attributes: < Component 5: Attributes: < Component 2: 1 string mismatch > >"                   
  > 
  > # kriging:
  > st_crs(st) = st_crs(meuse_sf) = NA # GDAL roundtrip messes them up!
  > k_st = if (Sys.getenv("USER") == "travis") {
  + 	try(krige(log(zinc)~1, meuse_sf, st, v.fit))
  + } else {
  + 	krige(log(zinc)~1, meuse_sf, st, v.fit)
  + }
  [using ordinary kriging]
  > k_st
  stars object with 2 dimensions and 2 attributes
  attribute(s):
     var1.pred       var1.var     
   Min.   :4.777   Min.   :0.085  
   1st Qu.:5.238   1st Qu.:0.137  
   Median :5.573   Median :0.162  
   Mean   :5.707   Mean   :0.185  
   3rd Qu.:6.172   3rd Qu.:0.212  
   Max.   :7.440   Max.   :0.500  
   NA's   :5009    NA's   :5009   
  dimension(s):
    from  to offset delta refsys point values    
  x    1  78 178440    40     NA    NA   NULL [x]
  y    1 104 333760   -40     NA    NA   NULL [y]
  > 
  > # handle factors, when going to stars?
  > k_sp_grd$cls = cut(k_sp_grd$var1.pred, c(0, 5, 6, 7, 8, 9))
  > st_as_stars(k_sp_grd)
  stars object with 2 dimensions and 3 attributes
  attribute(s):
     var1.pred       var1.var         cls      
   Min.   :4.777   Min.   :0.085   (0,5]: 316  
   1st Qu.:5.238   1st Qu.:0.137   (5,6]:1778  
   Median :5.573   Median :0.162   (6,7]: 962  
   Mean   :5.707   Mean   :0.185   (7,8]:  47  
   3rd Qu.:6.172   3rd Qu.:0.212   (8,9]:   0  
   Max.   :7.440   Max.   :0.500   NA's :5009  
   NA's   :5009    NA's   :5009                
  dimension(s):
    from  to offset delta                       refsys point values    
  x    1  78 178440    40 +proj=sterea +lat_0=52.15...    NA   NULL [x]
  y    1 104 333760   -40 +proj=sterea +lat_0=52.15...    NA   NULL [y]
  Warning messages:
  1: In sp::proj4string(.x) :
    CRS object has comment, which is lost in output
  2: In sp::proj4string(.x) :
    CRS object has comment, which is lost in output
  > st_as_stars(raster::stack(k_sp_grd)) # check
  Error in st_as_stars.Raster(raster::stack(k_sp_grd)) : 
    no slot of name "file" for this object of class "RasterStack"
  Calls: st_as_stars -> st_as_stars.Raster
  Execution halted