Running ‘allier.R’ [1s/2s]
  Comparing ‘allier.Rout’ to ‘allier.Rout.save’ ... OK
  Running ‘blockkr.R’ [1s/2s]
  Comparing ‘blockkr.Rout’ to ‘blockkr.Rout.save’ ... OK
  Running ‘covtable.R’ [1s/2s]
  Comparing ‘covtable.Rout’ to ‘covtable.Rout.save’ ... OK
  Running ‘cv.R’ [1s/2s]
  Comparing ‘cv.Rout’ to ‘cv.Rout.save’ ... OK
  Running ‘cv3d.R’ [2s/2s]
  Comparing ‘cv3d.Rout’ to ‘cv3d.Rout.save’ ... OK
  Running ‘fit.R’ [1s/2s]
  Comparing ‘fit.Rout’ to ‘fit.Rout.save’ ... OK
  Running ‘krige0.R’ [3s/4s]
  Comparing ‘krige0.Rout’ to ‘krige0.Rout.save’ ... OK
  Running ‘line.R’ [2s/3s]
  Comparing ‘line.Rout’ to ‘line.Rout.save’ ... OK
  Running ‘merge.R’ [1s/2s]
  Comparing ‘merge.Rout’ to ‘merge.Rout.save’ ... OK
  Running ‘na.action.R’ [1s/2s]
  Comparing ‘na.action.Rout’ to ‘na.action.Rout.save’ ... OK
  Running ‘rings.R’ [1s/2s]
  Comparing ‘rings.Rout’ to ‘rings.Rout.save’ ... OK
  Running ‘sim.R’ [1s/2s]
  Comparing ‘sim.Rout’ to ‘sim.Rout.save’ ... OK
  Running ‘stars.R’ [2s/3s]
  Running ‘unproj.R’ [0s/1s]
  Comparing ‘unproj.Rout’ to ‘unproj.Rout.save’ ...5,10c5,150
< > proc.time()
<    user  system elapsed 
<   0.177   0.037   0.376 
< Warning message:
< In library(package, lib.loc = lib.loc, character.only = TRUE, logical.return = TRUE,  :
<   there is no package called 'rgdal'
---
> rgdal: version: 1.4-3, (SVN revision 828)
>  Geospatial Data Abstraction Library extensions to R successfully loaded
>  Loaded GDAL runtime: GDAL 2.4.0, released 2018/12/14
>  Path to GDAL shared files: /usr/share/gdal
>  GDAL binary built with GEOS: TRUE 
>  Loaded PROJ.4 runtime: Rel. 5.2.0, September 15th, 2018, [PJ_VERSION: 520]
>  Path to PROJ.4 shared files: (autodetected)
>  Linking to sp version: 1.3-1 
> > 
> > # for validity of covariance functions on the sphere, see also:
> > # DOI 10.1007/s11004-011-9344-7
> > # http://mypage.iu.edu/~srobeson/Pubs/variogram_sphere_mathgeo_2011.pdf
> > 
> > library(sp)
> > data(meuse)
> > coordinates(meuse) = ~x+y
> > proj4string(meuse) = CRS("+init=epsg:28992")
> > #meuse.ll = spTransform(meuse, CRS("+proj=longlat +datum=WGS84 +ellps=WGS84"))
> > meuse.ll = spTransform(meuse, CRS("+proj=longlat +ellps=WGS84"))
> > meuse.ll[1:10,]
>             coordinates cadmium copper lead zinc  elev       dist   om ffreq
> 1  (5.759029, 50.99241)    11.7     85  299 1022 7.909 0.00135803 13.6     1
> 2  (5.758356, 50.99194)     8.6     81  277 1141 6.983 0.01222430 14.0     1
> 3  (5.760348, 50.99175)     6.5     68  199  640 7.800 0.10302900 13.0     1
> 4  (5.762239, 50.99126)     2.6     81  116  257 7.655 0.19009400  8.0     1
> 5  (5.762356, 50.98988)     2.8     48  117  269 7.480 0.27709000  8.7     1
> 6  (5.763533, 50.98924)     3.0     61  137  281 7.791 0.36406700  7.8     1
> 7  (5.760336, 50.99024)     3.2     31  132  346 8.217 0.19009400  9.2     1
> 8   (5.75837, 50.99019)     2.8     29  150  406 8.490 0.09215160  9.5     1
> 9    (5.758831, 50.989)     2.4     37  133  347 8.668 0.18461400 10.6     1
> 10 (5.761276, 50.98842)     1.6     24   80  183 9.049 0.30970200  6.3     1
>    soil lime landuse dist.m
> 1     1    1      Ah     50
> 2     1    1      Ah     30
> 3     1    1      Ah    150
> 4     2    0      Ga    270
> 5     2    0      Ah    380
> 6     2    0      Ga    470
> 7     2    0      Ah    240
> 8     1    0      Ab    120
> 9     1    0      Ab    240
> 10    2    0       W    420
> > library(gstat)
> > variogram(log(zinc)~1, meuse.ll)
>     np       dist     gamma dir.hor dir.ver   id
> 1   57 0.07930064 0.1234479       0       0 var1
> 2  299 0.16399059 0.2162185       0       0 var1
> 3  419 0.26739245 0.3027859       0       0 var1
> 4  457 0.37277392 0.4121448       0       0 var1
> 5  548 0.47862430 0.4626633       0       0 var1
> 6  533 0.58560071 0.5646904       0       0 var1
> 7  573 0.69331179 0.5698718       0       0 var1
> 8  566 0.79646175 0.6169183       0       0 var1
> 9  587 0.90341511 0.6489406       0       0 var1
> 10 544 1.01149382 0.6932668       0       0 var1
> 11 500 1.11819049 0.7009152       0       0 var1
> 12 479 1.22191097 0.6044300       0       0 var1
> 13 450 1.32976764 0.6507175       0       0 var1
> 14 456 1.43752185 0.5675707       0       0 var1
> 15 415 1.54336201 0.5748227       0       0 var1
> > 
> > cloud1 = variogram(log(zinc)~1, meuse, cloud=T, cutoff=6000)
> > cloud2 = variogram(log(zinc)~1, meuse.ll, cloud=T, cutoff=6)
> > 
> > plot(cloud1$dist/1000, cloud2$dist, xlab="Amersfoort, km", ylab = "Long/lat")
> > abline(0,1)
> > 
> > if (require(fields)) {
> +   data(ozone2)
> +   oz = SpatialPointsDataFrame(ozone2$lon.lat, 
> + 		  data.frame(t(ozone2$y)), 
> + 		  proj4string=CRS("+proj=longlat +datum=WGS84 +ellps=WGS84"))
> +   variogram(X870731~1,oz[!is.na(oz$X870731),])
> +   utm16 = CRS("+proj=utm +zone=16 +ellps=WGS84")
> +   oz.utm = spTransform(oz, utm16)
> +   variogram(X870731~1,oz.utm[!is.na(oz$X870731),])
> + }
> Spam version 2.2-2 (2019-03-07) is loaded.
> Type 'help( Spam)' or 'demo( spam)' for a short introduction 
> and overview of this package.
> Help for individual functions is also obtained by adding the
> suffix '.spam' to the function name, e.g. 'help( chol.spam)'.
> 
> Attaching package: 'spam'
> 
> The following objects are masked from 'package:base':
> 
>     backsolve, forwardsolve
> 
> See https://github.com/NCAR/Fields for
>  an extensive vignette, other supplements and source code 
>     np      dist    gamma dir.hor dir.ver   id
> 1  197  17443.99 143.5037       0       0 var1
> 2  245  40383.30 180.5144       0       0 var1
> 3  211  69178.16 134.2920       0       0 var1
> 4  278  97068.08 174.2017       0       0 var1
> 5  283 123380.15 232.2221       0       0 var1
> 6  393 151741.31 318.7762       0       0 var1
> 7  356 178620.56 312.9364       0       0 var1
> 8  400 206865.15 314.7740       0       0 var1
> 9  485 234294.31 340.8188       0       0 var1
> 10 476 261547.41 331.8010       0       0 var1
> 11 427 288749.42 267.5269       0       0 var1
> 12 452 317219.28 308.6634       0       0 var1
> 13 467 344418.75 365.8126       0       0 var1
> 14 596 372513.02 395.8868       0       0 var1
> 15 784 399259.25 490.6399       0       0 var1
> > 
> > # Timothy Hilton, r-sig-geo, Sept 14, 2008:
> > 
> > foo <-
> + structure(list(z = c(-1.95824831109744, -1.9158901643563, 4.22211761150161,
> + 3.23356929459598, 1.12038389231868, 0.34613850821113, 1.12589932643631,
> + 23.517912251617, 3.0519158690268, 3.20261431141517, -2.10947106854739
> + ), lon = c(-125.29228, -82.1556, -98.524722, -99.948333, -104.691741,
> + -79.420833, -105.100533, -88.291867, -72.171478, -121.556944,
> + -89.34765), lat = c(49.87217, 48.2167, 55.905833, 56.635833,
> + 53.916264, 39.063333, 48.307883, 40.0061, 42.537756, 44.448889,
> + 46.242017)), .Names = c("z", "lon", "lat"), row.names = c(NA,
> + -11L), class = "data.frame")
> > 
> > coordinates(foo) <- ~lon+lat
> > 
> > proj4string(foo) <- CRS('+proj=longlat +datum=WGS84 +ellps=WGS84')
> > 
> > vg.foo <- variogram(z~1, foo, cloud=TRUE, cutoff=1e10)
> > 
> > cat('==========\nvariogram:\n')
> ==========
> variogram:
> > print(head(vg.foo))
>        dist        gamma dir.hor dir.ver   id left right
> 1 3115.1190 8.971063e-04       0       0 var1    2     1
> 2 1908.0468 1.909846e+01       0       0 var1    3     1
> 3 1405.6211 1.883757e+01       0       0 var1    3     2
> 4 1837.5667 1.347749e+01       0       0 var1    4     1
> 5 1522.8765 1.325847e+01       0       0 var1    4     2
> 6  119.9386 4.886139e-01       0       0 var1    4     3
> > 
> > cat('==========\nspDistsN1 Distances:\n')
> ==========
> spDistsN1 Distances:
> > print(spDistsN1(coordinates(foo), coordinates(foo)[1,], longlat=TRUE))
>  [1]    0.0000 3115.1190 1908.0468 1837.5667 1481.6293 3775.6751 1480.4477
>  [8] 3081.7541 4090.4022  665.9348 2683.1516
> > 
  Running ‘variogram.R’ [1s/2s]
  Comparing ‘variogram.Rout’ to ‘variogram.Rout.save’ ... OK
  Running ‘vdist.R’ [1s/2s]
  Comparing ‘vdist.Rout’ to ‘vdist.Rout.save’ ... OK
  Running ‘windst.R’ [1s/2s]
Running the tests in ‘tests/stars.R’ failed.
Complete output:
  > # 0. using sp:
  > 
  > 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
  > 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]
  > k_sp_grd = krige(log(zinc)~1, meuse, meuse.grid, v.fit)
  [using ordinary kriging]
  > 
  > # 1. using sf:
  > library(sf)
  Linking to GEOS 3.7.2, GDAL 2.4.2, PROJ 6.2.0
  > 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
  > 
  > library(gstat)
  > v = variogram(log(zinc)~1, meuse_sf)
  > (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
  > 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 \"projargs\": 1 string mismatch > >"          
  > 
  > # 2. using stars for grid:
  > 
  > library(rgdal)
  Error in library(rgdal) : there is no package called 'rgdal'
  Execution halted
Running the tests in ‘tests/windst.R’ failed.
Complete output:
  > library(sp)
  > library(spacetime)
  > library(gstat)
  > 
  > data(wind)
  > wind.loc$y = as.numeric(char2dms(as.character(wind.loc[["Latitude"]])))
  > wind.loc$x = as.numeric(char2dms(as.character(wind.loc[["Longitude"]])))
  > coordinates(wind.loc) = ~x+y
  > proj4string(wind.loc) = "+proj=longlat +datum=WGS84 +ellps=WGS84"
  > 
  > wind$time = ISOdate(wind$year+1900, wind$month, wind$day)
  > wind$jday = as.numeric(format(wind$time, '%j'))
  > stations = 4:15
  > windsqrt = sqrt(0.5148 * wind[stations]) # knots -> m/s
  > Jday = 1:366
  > daymeans = colMeans(
  + 	sapply(split(windsqrt - colMeans(windsqrt), wind$jday), colMeans))
  > meanwind = lowess(daymeans ~ Jday, f = 0.1)$y[wind$jday]
  > velocities = apply(windsqrt, 2, function(x) { x - meanwind })
  > # match order of columns in wind to Code in wind.loc;
  > # convert to utm zone 29, to be able to do interpolation in
  > # proper Euclidian (projected) space:
  > pts = coordinates(wind.loc[match(names(wind[4:15]), wind.loc$Code),])
  > pts = SpatialPoints(pts)
  > #if (require(rgdal) && require(maps)) {
  > proj4string(pts) = "+proj=longlat +datum=WGS84 +ellps=WGS84"
  > utm29 = CRS("+proj=utm +zone=29 +datum=WGS84 +ellps=WGS84")
  > pts = spTransform(pts, utm29)
  Error in spTransform(pts, utm29) : 
    package rgdal is required for spTransform methods
  Calls: spTransform -> spTransform
  Execution halted