Running ‘aggregate.R’ [2s/3s]
  Comparing ‘aggregate.Rout’ to ‘aggregate.Rout.save’ ...4c4
< Linking to GEOS 3.10.2, GDAL 3.4.2, PROJ 9.0.0; sf_use_s2() is TRUE
---
> Linking to GEOS 3.10.1, GDAL 3.4.0, PROJ 8.2.0; sf_use_s2() is TRUE
  Running ‘cast.R’ [3s/4s]
  Comparing ‘cast.Rout’ to ‘cast.Rout.save’ ... OK
  Running ‘crs.R’ [2s/4s]
  Comparing ‘crs.Rout’ to ‘crs.Rout.save’ ...72c72,108
<  
---
> GEOGCRS["WGS 84",
>     ENSEMBLE["World Geodetic System 1984 ensemble",
>         MEMBER["World Geodetic System 1984 (Transit)",
>             ID["EPSG",1166]],
>         MEMBER["World Geodetic System 1984 (G730)",
>             ID["EPSG",1152]],
>         MEMBER["World Geodetic System 1984 (G873)",
>             ID["EPSG",1153]],
>         MEMBER["World Geodetic System 1984 (G1150)",
>             ID["EPSG",1154]],
>         MEMBER["World Geodetic System 1984 (G1674)",
>             ID["EPSG",1155]],
>         MEMBER["World Geodetic System 1984 (G1762)",
>             ID["EPSG",1156]],
>         MEMBER["World Geodetic System 1984 (G2139)",
>             ID["EPSG",1309]],
>         ELLIPSOID["WGS 84",6378137,298.257223563,
>             LENGTHUNIT["metre",1],
>             ID["EPSG",7030]],
>         ENSEMBLEACCURACY[2.0],
>         ID["EPSG",6326]],
>     PRIMEM["Greenwich",0,
>         ANGLEUNIT["degree",0.0174532925199433],
>         ID["EPSG",8901]],
>     CS[ellipsoidal,2],
>         AXIS["longitude",east,
>             ORDER[1],
>             ANGLEUNIT["degree",0.0174532925199433,
>                 ID["EPSG",9122]]],
>         AXIS["latitude",north,
>             ORDER[2],
>             ANGLEUNIT["degree",0.0174532925199433,
>                 ID["EPSG",9122]]],
>     USAGE[
>         SCOPE["unknown"],
>         AREA["World."],
>         BBOX[-90,-180,90,180]]] 
74,76d109
< Warning message:
< In CPL_crs_from_input(x) :
<   GDAL Message 1: +init=epsg:XXXX syntax is deprecated. It might return a CRS with a non-EPSG compliant axis order.
79c112
<   User input: +init=epsg:4326 
---
>   User input: WGS 84 
  Running ‘dist.R’ [2s/4s]
  Comparing ‘dist.Rout’ to ‘dist.Rout.save’ ... OK
  Running ‘dplyr.R’ [5s/7s]
  Running ‘empty.R’ [2s/3s]
  Comparing ‘empty.Rout’ to ‘empty.Rout.save’ ... OK
  Running ‘gdal_geom.R’ [3s/4s]
  Comparing ‘gdal_geom.Rout’ to ‘gdal_geom.Rout.save’ ...241,245c241,245
< [1,] 1760230516 0.114
< [2,]  946417787 0.061
< [3,] 2202223078 0.143
< [4,] 1074332698 0.070
< [5,] 2352528086 0.153
---
> [1,] 1760244967 0.114
> [2,]  946435667 0.061
> [3,] 2202248253 0.143
> [4,] 1074351919 0.070
> [5,] 2352539533 0.153
  Running ‘geos.R’ [21s/30s]
  Comparing ‘geos.Rout’ to ‘geos.Rout.save’ ...13,22c13,22
<  [1,]      0.00      0.00  25651.99 440561.48 299772.34 361529.73 419671.66
<  [2,]      0.00      0.00      0.00 409429.44 268945.05 332590.52 388545.58
<  [3,]  25651.99      0.00      0.00 367556.52 227018.38 290298.04 346669.14
<  [4,] 440561.48 409429.44 367556.52      0.00  67226.86  45537.62      0.00
<  [5,] 299772.34 268945.05 227018.38  67226.86      0.00      0.00  46527.56
<  [6,] 361529.73 332590.52 290298.04  45537.62      0.00      0.00  30213.17
<  [7,] 419671.66 388545.58 346669.14      0.00  46527.56  30213.17      0.00
<  [8,] 384593.29 354295.06 312351.76  16130.19  11926.86      0.00      0.00
<  [9,] 262353.97 231217.73 189310.73 140455.97      0.00  64606.27 119564.00
< [10,]  71138.53  41943.71      0.00 330752.58 190183.42 252373.26 309863.33
---
>  [1,]      0.00      0.00  25652.53 440561.15 299772.18 361529.53 419671.2
>  [2,]      0.00      0.00      0.00 409428.54 268944.31 332589.77 388544.5
>  [3,]  25652.53      0.00      0.00 367555.48 227017.51 290297.10 346667.9
>  [4,] 440561.15 409428.54 367555.48      0.00  67226.86  45537.55      0.0
>  [5,] 299772.18 268944.31 227017.51  67226.86      0.00      0.00  46527.4
>  [6,] 361529.53 332589.77 290297.10  45537.55      0.00      0.00  30213.0
>  [7,] 419671.16 388544.52 346667.93      0.00  46527.40  30213.00      0.0
>  [8,] 384592.90 354294.11 312350.68  16130.34  11926.81      0.00      0.0
>  [9,] 262354.29 231217.49 189310.35 140455.87      0.00  64606.24 119563.7
> [10,]  71139.29  41943.83      0.00 330751.39 190182.39 252372.06 309862.0
24,33c24,33
<  [1,] 384593.29 262353.97  71138.53
<  [2,] 354295.06 231217.73  41943.71
<  [3,] 312351.76 189310.73      0.00
<  [4,]  16130.19 140455.97 330752.58
<  [5,]  11926.86      0.00 190183.42
<  [6,]      0.00  64606.27 252373.26
<  [7,]      0.00 119564.00 309863.33
<  [8,]      0.00  85533.33 275391.07
<  [9,]  85533.33      0.00 152489.45
< [10,] 275391.07 152489.45      0.00
---
>  [1,] 384592.90 262354.29  71139.29
>  [2,] 354294.11 231217.49  41943.83
>  [3,] 312350.68 189310.35      0.00
>  [4,]  16130.34 140455.87 330751.39
>  [5,]  11926.81      0.00 190182.39
>  [6,]      0.00  64606.24 252372.06
>  [7,]      0.00 119563.73 309861.97
>  [8,]      0.00  85533.12 275389.78
>  [9,]  85533.12      0.00 152488.92
> [10,] 275389.78 152488.92      0.00
  Running ‘graticule.R’ [4s/6s]
  Comparing ‘graticule.Rout’ to ‘graticule.Rout.save’ ... OK
  Running ‘grid.R’ [2s/4s]
  Comparing ‘grid.Rout’ to ‘grid.Rout.save’ ... OK
  Running ‘maps.R’ [4s/6s]
  Comparing ‘maps.Rout’ to ‘maps.Rout.save’ ... OK
  Running ‘plot.R’ [9s/13s]
  Comparing ‘plot.Rout’ to ‘plot.Rout.save’ ... OK
  Running ‘read.R’ [3s/4s]
  Comparing ‘read.Rout’ to ‘read.Rout.save’ ...223,225c223,300
< Warning message:
< In library(package, lib.loc = lib.loc, character.only = TRUE, logical.return = TRUE,  :
<   there is no package called 'RSQLite'
---
> Simple feature collection with 155 features and 13 fields
> Geometry type: POINT
> Dimension:     XY
> Bounding box:  xmin: 178605 ymin: 329714 xmax: 181390 ymax: 333611
> CRS:           NA
> First 3 features:
>   ogc_fid cadmium copper lead zinc  elev       dist   om ffreq soil lime
> 1       1    11.7     85  299 1022 7.909 0.00135803 13.6     1    1    1
> 2       2     8.6     81  277 1141 6.983 0.01222430 14.0     1    1    1
> 3       3     6.5     68  199  640 7.800 0.10302900 13.0     1    1    1
>   landuse dist.m              GEOMETRY
> 1      Ah     50 POINT (181072 333611)
> 2      Ah     30 POINT (181025 333558)
> 3      Ah    150 POINT (181165 333537)
> Simple feature collection with 100 features and 15 fields
> Geometry type: MULTIPOLYGON
> Dimension:     XY
> Bounding box:  xmin: -84.32385 ymin: 33.88199 xmax: -75.45698 ymax: 36.58965
> CRS:           NA
> First 3 features:
>   ogc_fid  area perimeter cnty_ cnty_id      name  fips fipsno cress_id bir74
> 1       1 0.114     1.442  1825    1825      Ashe 37009  37009        5  1091
> 2       2 0.061     1.231  1827    1827 Alleghany 37005  37005        3   487
> 3       3 0.143     1.630  1828    1828     Surry 37171  37171       86  3188
>   sid74 nwbir74 bir79 sid79 nwbir79                       GEOMETRY
> 1     1      10  1364     0      19 MULTIPOLYGON (((-81.47276 3...
> 2     0      10   542     3      12 MULTIPOLYGON (((-81.23989 3...
> 3     5     208  3616     6     260 MULTIPOLYGON (((-80.45634 3...
> Integer64 values larger than 9.0072e+15 lost significance after conversion to double;
> use argument int64_as_string = TRUE to import them lossless, as character
> Simple feature collection with 1 feature and 2 fields
> Geometry type: POINT
> Dimension:     XY
> Bounding box:  xmin: 0 ymin: 1 xmax: 0 ymax: 1
> CRS:           NA
>   a       bigint    GEOMETRY
> 1 1 4.611686e+18 POINT (0 1)
> Simple feature collection with 1 feature and 2 fields
> Geometry type: POINT
> Dimension:     XY
> Bounding box:  xmin: 0 ymin: 1 xmax: 0 ymax: 1
> CRS:           NA
>   a              bigint    GEOMETRY
> 1 1 4611686018427387904 POINT (0 1)
> Simple feature collection with 10 features and 2 fields
> Geometry type: LINESTRING
> Dimension:     XY
> Bounding box:  xmin: 645003 ymin: 4822568 xmax: 748805.6 ymax: 4992001
> Projected CRS: WGS 84 / UTM zone 32N
> First 3 features:
>   PK_UID    Name                       Geometry
> 1      1 Unknown LINESTRING (668540.7 485826...
> 2      2 Unknown LINESTRING (671365.9 485417...
> 3      3 Unknown LINESTRING (671417.6 485417...
> Simple feature collection with 8101 features and 6 fields
> Geometry type: POINT
> Dimension:     XY
> Bounding box:  xmin: 319224 ymin: 3934674 xmax: 1308585 ymax: 5214373
> Projected CRS: WGS 84 / UTM zone 32N
> First 3 features:
>   PK_UID               Name Peoples LocalCounc County Region
> 1      1            Brozolo     435          1      0      0
> 2      2 Campiglione-Fenile    1284          1      0      0
> 3      3          Canischio     274          1      0      0
>                   Geometry
> 1 POINT (427002.8 4996361)
> 2 POINT (367470.5 4962414)
> 3 POINT (390084.1 5025552)
> Simple feature collection with 10 features and 2 fields
> Geometry type: MULTIPOLYGON
> Dimension:     XY
> Bounding box:  xmin: 378359.8 ymin: 4198234 xmax: 1211486 ymax: 5036803
> Projected CRS: WGS 84 / UTM zone 32N
> First 3 features:
>   PK_UID   Name                       Geometry
> 1      1 VENETO MULTIPOLYGON (((752912.3 50...
> 2      2 VENETO MULTIPOLYGON (((751705.5 50...
> 3      3 VENETO MULTIPOLYGON (((766247.8 50...
246,248d320
< Warning message:
< In CPL_read_ogr(dsn, layer, query, as.character(options), quiet,  :
<   GDAL Message 1: GFS file saving asked, but failed
262,263c334
<   `/home/hornik/tmp/R.check/r-devel-gcc/Work/PKGS/sf.Rcheck/tests/tst__.gpkg' 
<   using driver `GPKG'
---
>   `/home/edzer/git/sf.Rcheck/tests/tst__.gpkg' using driver `GPKG'
  Running ‘roundtrip.R’ [3s/5s]
  Comparing ‘roundtrip.Rout’ to ‘roundtrip.Rout.save’ ... OK
  Running ‘s2.R’ [3s/5s]
  Comparing ‘s2.Rout’ to ‘s2.Rout.save’ ...4c4
< Linking to GEOS 3.10.2, GDAL 3.4.2, PROJ 9.0.0; sf_use_s2() is TRUE
---
> Linking to GEOS 3.10.1, GDAL 3.4.0, PROJ 8.2.0; sf_use_s2() is TRUE
  Running ‘sample.R’ [2s/3s]
  Comparing ‘sample.Rout’ to ‘sample.Rout.save’ ... OK
  Running ‘sfc.R’ [13s/20s]
  Running ‘sfg.R’ [2s/3s]
  Comparing ‘sfg.Rout’ to ‘sfg.Rout.save’ ... OK
  Running ‘spatstat.R’ [0s/1s]
  Running ‘stars.R’ [2s/2s]
  Comparing ‘stars.Rout’ to ‘stars.Rout.save’ ...79,81c79,231
< Warning message:
< In library(package, lib.loc = lib.loc, character.only = TRUE, logical.return = TRUE,  :
<   there is no package called 'stars'
---
> [1] TRUE
> [1] TRUE
> Geometry set for 20 features 
> Geometry type: POINT
> Dimension:     XY
> Bounding box:  xmin: 0.25 ymin: 0.4 xmax: 4.5 ymax: 2.1
> CRS:           NA
> First 5 geometries:
> POINT (0.25 0.4)
> POINT (0.75 0.4)
> POINT (1.5 0.4)
> POINT (3 0.4)
> POINT (4.5 0.4)
> Geometry set for 20 features 
> Geometry type: POLYGON
> Dimension:     XY
> Bounding box:  xmin: 0 ymin: 0.3 xmax: 5 ymax: 2.2
> CRS:           NA
> First 5 geometries:
> POLYGON ((0 0.3, 0.5 0.3, 0.5 0.5, 0 0.5, 0 0.3))
> POLYGON ((0.5 0.3, 1 0.3, 1 0.5, 0.5 0.5, 0.5 0...
> POLYGON ((1 0.3, 2 0.3, 2 0.5, 1 0.5, 1 0.3))
> POLYGON ((2 0.3, 4 0.3, 4 0.5, 2 0.5, 2 0.3))
> POLYGON ((4 0.3, 5 0.3, 5 0.5, 4 0.5, 4 0.3))
> Geometry set for 20 features 
> Geometry type: POINT
> Dimension:     XY
> Bounding box:  xmin: 1 ymin: 1 xmax: 5 ymax: 4
> Geodetic CRS:  WGS 84
> First 5 geometries:
> POINT (1 1)
> POINT (1 2)
> POINT (1 3)
> POINT (1 4)
> POINT (2 1)
> Geometry set for 20 features 
> Geometry type: POLYGON
> Dimension:     XY
> Bounding box:  xmin: 0.5 ymin: 0.5 xmax: 5.5 ymax: 4.5
> Geodetic CRS:  WGS 84
> First 5 geometries:
> POLYGON ((0.5 0.5, 0.5 1.5, 1.5 1.5, 1.5 0.5, 0...
> POLYGON ((0.5 1.5, 0.5 2.5, 1.5 2.5, 1.5 1.5, 0...
> POLYGON ((0.5 2.5, 0.5 3.5, 1.5 3.5, 1.5 2.5, 0...
> POLYGON ((0.5 3.5, 0.5 4.5, 1.5 4.5, 1.5 3.5, 0...
> POLYGON ((1.5 0.5, 1.5 1.5, 2.5 1.5, 2.5 0.5, 1...
> stars object with 2 dimensions and 12 attributes
> attribute(s):
>                 Min.   1st Qu.    Median         Mean   3rd Qu.      Max.  NA's
> AREA           0.042     0.108     0.142 1.451932e-01     0.181     0.241 30904
> PERIMETER      0.999     1.461     1.716 1.786110e+00     2.004     3.640 30904
> CNTY_       1825.000  1907.000  1989.000 1.998403e+03  2085.000  2241.000 30904
> CNTY_ID     1825.000  1907.000  1989.000 1.998403e+03  2085.000  2241.000 30904
> FIPSNO     37001.000 37049.000 37101.000 3.710042e+04 37153.000 37199.000 30904
> CRESS_ID       1.000    25.000    51.000 5.071206e+01    77.000   100.000 30904
> BIR74        248.000  1323.000  2648.000 3.791637e+03  4139.000 21588.000 30904
> SID74          0.000     3.000     5.000 7.891985e+00    10.000    44.000 30904
> NWBIR74        1.000   297.000   844.000 1.246210e+03  1396.000  8027.000 30904
> BIR79        319.000  1606.000  3108.000 4.852046e+03  5400.000 30757.000 30904
> SID79          0.000     3.000     6.000 9.584098e+00    13.000    57.000 30904
> NWBIR79        3.000   360.000  1058.000 1.604642e+03  1524.000 11631.000 30904
> dimension(s):
>   from  to   offset      delta refsys point values x/y
> x    1 461 -84.3239  0.0192484  NAD27 FALSE   NULL [x]
> y    1 141  36.5896 -0.0192484  NAD27 FALSE   NULL [y]
> Simple feature collection with 34097 features and 12 fields
> Geometry type: POLYGON
> Dimension:     XY
> Bounding box:  xmin: -84.32385 ymin: 33.87563 xmax: -75.45034 ymax: 36.58965
> Geodetic CRS:  NAD27
> First 10 features:
>     AREA PERIMETER CNTY_ CNTY_ID FIPSNO CRESS_ID BIR74 SID74 NWBIR74 BIR79
> 1  0.114     1.442  1825    1825  37009        5  1091     1      10  1364
> 2  0.114     1.442  1825    1825  37009        5  1091     1      10  1364
> 3  0.114     1.442  1825    1825  37009        5  1091     1      10  1364
> 4  0.114     1.442  1825    1825  37009        5  1091     1      10  1364
> 5  0.114     1.442  1825    1825  37009        5  1091     1      10  1364
> 6  0.114     1.442  1825    1825  37009        5  1091     1      10  1364
> 7  0.114     1.442  1825    1825  37009        5  1091     1      10  1364
> 8  0.114     1.442  1825    1825  37009        5  1091     1      10  1364
> 9  0.114     1.442  1825    1825  37009        5  1091     1      10  1364
> 10 0.114     1.442  1825    1825  37009        5  1091     1      10  1364
>    SID79 NWBIR79                       geometry
> 1      0      19 POLYGON ((-81.66757 36.5896...
> 2      0      19 POLYGON ((-81.64833 36.5896...
> 3      0      19 POLYGON ((-81.62908 36.5896...
> 4      0      19 POLYGON ((-81.60983 36.5896...
> 5      0      19 POLYGON ((-81.59058 36.5896...
> 6      0      19 POLYGON ((-81.57133 36.5896...
> 7      0      19 POLYGON ((-81.55208 36.5896...
> 8      0      19 POLYGON ((-81.53283 36.5896...
> 9      0      19 POLYGON ((-81.51359 36.5896...
> 10     0      19 POLYGON ((-81.49434 36.5896...
> Simple feature collection with 34097 features and 12 fields
> Geometry type: POLYGON
> Dimension:     XY
> Bounding box:  xmin: -84.32385 ymin: 33.87563 xmax: -75.45034 ymax: 36.58965
> Geodetic CRS:  NAD27
> First 10 features:
>     AREA PERIMETER CNTY_ CNTY_ID FIPSNO CRESS_ID BIR74 SID74 NWBIR74 BIR79
> 1  0.114     1.442  1825    1825  37009        5  1091     1      10  1364
> 2  0.114     1.442  1825    1825  37009        5  1091     1      10  1364
> 3  0.114     1.442  1825    1825  37009        5  1091     1      10  1364
> 4  0.114     1.442  1825    1825  37009        5  1091     1      10  1364
> 5  0.114     1.442  1825    1825  37009        5  1091     1      10  1364
> 6  0.114     1.442  1825    1825  37009        5  1091     1      10  1364
> 7  0.114     1.442  1825    1825  37009        5  1091     1      10  1364
> 8  0.114     1.442  1825    1825  37009        5  1091     1      10  1364
> 9  0.114     1.442  1825    1825  37009        5  1091     1      10  1364
> 10 0.114     1.442  1825    1825  37009        5  1091     1      10  1364
>    SID79 NWBIR79                       geometry
> 1      0      19 POLYGON ((-81.66757 36.5896...
> 2      0      19 POLYGON ((-81.64833 36.5896...
> 3      0      19 POLYGON ((-81.62908 36.5896...
> 4      0      19 POLYGON ((-81.60983 36.5896...
> 5      0      19 POLYGON ((-81.59058 36.5896...
> 6      0      19 POLYGON ((-81.57133 36.5896...
> 7      0      19 POLYGON ((-81.55208 36.5896...
> 8      0      19 POLYGON ((-81.53283 36.5896...
> 9      0      19 POLYGON ((-81.51359 36.5896...
> 10     0      19 POLYGON ((-81.49434 36.5896...
> Simple feature collection with 34097 features and 12 fields
> Geometry type: POINT
> Dimension:     XY
> Bounding box:  xmin: -84.31423 ymin: 33.88525 xmax: -75.45997 ymax: 36.58003
> Geodetic CRS:  NAD27
> First 10 features:
>     AREA PERIMETER CNTY_ CNTY_ID FIPSNO CRESS_ID BIR74 SID74 NWBIR74 BIR79
> 1  0.114     1.442  1825    1825  37009        5  1091     1      10  1364
> 2  0.114     1.442  1825    1825  37009        5  1091     1      10  1364
> 3  0.114     1.442  1825    1825  37009        5  1091     1      10  1364
> 4  0.114     1.442  1825    1825  37009        5  1091     1      10  1364
> 5  0.114     1.442  1825    1825  37009        5  1091     1      10  1364
> 6  0.114     1.442  1825    1825  37009        5  1091     1      10  1364
> 7  0.114     1.442  1825    1825  37009        5  1091     1      10  1364
> 8  0.114     1.442  1825    1825  37009        5  1091     1      10  1364
> 9  0.114     1.442  1825    1825  37009        5  1091     1      10  1364
> 10 0.114     1.442  1825    1825  37009        5  1091     1      10  1364
>    SID79 NWBIR79                   geometry
> 1      0      19 POINT (-81.65795 36.58003)
> 2      0      19  POINT (-81.6387 36.58003)
> 3      0      19 POINT (-81.61945 36.58003)
> 4      0      19  POINT (-81.6002 36.58003)
> 5      0      19 POINT (-81.58096 36.58003)
> 6      0      19 POINT (-81.56171 36.58003)
> 7      0      19 POINT (-81.54246 36.58003)
> 8      0      19 POINT (-81.52321 36.58003)
> 9      0      19 POINT (-81.50396 36.58003)
> 10     0      19 POINT (-81.48471 36.58003)
> 
> 
> 
> 
  Running ‘testthat.R’ [10s/17s]
  Running ‘units.R’ [3s/4s]
  Comparing ‘units.Rout’ to ‘units.Rout.save’ ... OK
  Running ‘wkb.R’ [2s/4s]
  Comparing ‘wkb.Rout’ to ‘wkb.Rout.save’ ... OK
Running the tests in ‘tests/dplyr.R’ failed.
Complete output:
  > suppressPackageStartupMessages(library(sf))
  > 
  > library(dplyr)
  
  Attaching package: 'dplyr'
  
  The following objects are masked from 'package:stats':
  
      filter, lag
  
  The following objects are masked from 'package:base':
  
      intersect, setdiff, setequal, union
  
  > options(dplyr.summarise.inform=FALSE)
  > read_sf(system.file("shape/nc.shp", package="sf"), quiet = TRUE) %>%
  + 	st_transform(3857) -> nc
  > nc %>% filter(AREA > .1) %>% plot()
  Warning message:
  plotting the first 10 out of 14 attributes; use max.plot = 14 to plot all 
  > 
  > # plot 10 smallest counties in grey:
  > nc %>% 
  +   select(BIR74, geometry) %>% 
  +   plot()
  > 
  > nc %>% 
  +   select(AREA, geometry) %>% 
  +   arrange(AREA) %>% 
  +   slice(1:10) %>% 
  +   plot(add = TRUE, col = 'grey', main ="")
  > 
  > # select: check both when geometry is part of the selection, and when not:
  > nc %>% select(SID74, SID79) %>% names()
  [1] "SID74"    "SID79"    "geometry"
  > nc %>% select(SID74, SID79, geometry) %>% names()
  [1] "SID74"    "SID79"    "geometry"
  > nc %>% select(SID74, SID79) %>% class()
  [1] "sf"         "tbl_df"     "tbl"        "data.frame"
  > nc %>% select(SID74, SID79, geometry) %>% class()
  [1] "sf"         "tbl_df"     "tbl"        "data.frame"
  > 
  > # group_by:
  > nc$area_cl = cut(nc$AREA, c(0, .1, .12, .15, .25))
  > nc %>% group_by(area_cl) %>% class()
  [1] "sf"         "grouped_df" "tbl_df"     "tbl"        "data.frame"
  > 
  > # mutate:
  > nc2 <- nc %>% mutate(area10 = AREA/10)
  > 
  > # transmute:
  > nc %>% transmute(AREA = AREA/10, geometry = geometry) %>% class()
  [1] "sf"         "tbl_df"     "tbl"        "data.frame"
  > nc %>% transmute(AREA = AREA/10) %>% class()
  [1] "sf"         "tbl_df"     "tbl"        "data.frame"
  > 
  > # rename:
  > nc2 <- nc %>% rename(area = AREA)
  > 
  > # distinct:
  > nc[c(1:100,1:10),] %>% distinct() %>% nrow()
  [1] 100
  > 
  > # summarize:
  > nc$area_cl = cut(nc$AREA, c(0, .1, .12, .15, .25))
  > nc.g <- nc %>% group_by(area_cl)
  > nc.g %>% summarise(mean(AREA))
  Simple feature collection with 4 features and 2 fields
  Geometry type: MULTIPOLYGON
  Dimension:     XY
  Bounding box:  xmin: -9386879 ymin: 4012985 xmax: -8399792 ymax: 4382074
  Projected CRS: WGS 84 / Pseudo-Mercator
  # A tibble: 4 × 3
    area_cl     `mean(AREA)`                                              geometry
    <fct>              <dbl>                                    <MULTIPOLYGON [m]>
  1 (0,0.1]           0.0760 (((-8863447 4143472, -8857175 4151333, -8858837 4156…
  2 (0.1,0.12]        0.112  (((-9362142 4197316, -9355589 4201000, -9354262 4203…
  3 (0.12,0.15]       0.134  (((-9302072 4171501, -9311147 4181236, -9311293 4183…
  4 (0.15,0.25]       0.190  (((-8830723 4133011, -8832558 4137948, -8832096 4141…
  > nc.g %>% summarize(mean(AREA)) %>% plot(col = 3:6/7)
  > 
  > library(tidyr)
  > 
  > # time-wide to long table, using tidyr::gather
  > # stack the two SID columns for the July 1, 1974 - June 30, 1978 and July 1, 1979 - June 30, 1984 periods
  > # (see https://cran.r-project.org/web/packages/spdep/vignettes/sids.pdf)
  > nc %>% select(SID74, SID79, geometry) %>% gather("VAR", "SID", -geometry) %>% summary()
            geometry       VAR                 SID        
   MULTIPOLYGON :200   Length:200         Min.   : 0.000  
   epsg:3857    :  0   Class :character   1st Qu.: 2.000  
   +proj=merc...:  0   Mode  :character   Median : 5.000  
                                          Mean   : 7.515  
                                          3rd Qu.: 9.000  
                                          Max.   :57.000  
  > 
  > # spread:
  > nc$row = 1:100
  > nc.g <- nc %>% select(SID74, SID79, row) %>% gather("VAR", "SID", -row, -geometry)
  > nc.g %>% tail()
  Simple feature collection with 6 features and 3 fields
  Geometry type: MULTIPOLYGON
  Dimension:     XY
  Bounding box:  xmin: -8802506 ymin: 4012985 xmax: -8492272 ymax: 4166159
  Projected CRS: WGS 84 / Pseudo-Mercator
  # A tibble: 6 × 4
      row                                                     geometry VAR     SID
    <int>                                           <MULTIPOLYGON [m]> <chr> <dbl>
  1    95 (((-8588149 4131915, -8589852 4133296, -8589358 4135190, -8… SID79     4
  2    96 (((-8712000 4081952, -8719512 4077857, -8731642 4078857, -8… SID79     5
  3    97 (((-8685776 4073050, -8697388 4077816, -8700121 4077563, -8… SID79     3
  4    98 (((-8755886 4021930, -8802506 4069789, -8798771 4071773, -8… SID79    17
  5    99 (((-8678518 4054258, -8679090 4061398, -8680138 4061543, -8… SID79     9
  6   100 (((-8755886 4021930, -8753548 4025863, -8753053 4030189, -8… SID79     6
  > nc.g %>% spread(VAR, SID) %>% head()
  Simple feature collection with 6 features and 3 fields
  Geometry type: MULTIPOLYGON
  Dimension:     XY
  Bounding box:  xmin: -9099356 ymin: 4310656 xmax: -8434990 ymax: 4382074
  Projected CRS: WGS 84 / Pseudo-Mercator
  # A tibble: 6 × 4
      row                                                     geometry SID74 SID79
    <int>                                           <MULTIPOLYGON [m]> <dbl> <dbl>
  1     1 (((-9069486 4332928, -9077065 4338195, -9079419 4338345, -9…     1     0
  2     2 (((-9043563 4351024, -9043652 4352966, -9046118 4356510, -9…     0     3
  3     3 (((-8956336 4334060, -8958567 4335740, -8965302 4336017, -8…     5     6
  4     4 (((-8461242 4344697, -8462174 4347203, -8463903 4346960, -8…     1     2
  5     5 (((-8595797 4333842, -8597684 4330201, -8604809 4329777, -8…     9     3
  6     6 (((-8543186 4332866, -8569416 4332359, -8570982 4333096, -8…     7     5
  > nc %>% select(SID74, SID79, geometry, row) %>% gather("VAR", "SID", -geometry, -row) %>% spread(VAR, SID) %>% head()
  Simple feature collection with 6 features and 3 fields
  Geometry type: MULTIPOLYGON
  Dimension:     XY
  Bounding box:  xmin: -9099356 ymin: 4310656 xmax: -8434990 ymax: 4382074
  Projected CRS: WGS 84 / Pseudo-Mercator
  # A tibble: 6 × 4
                                                        geometry   row SID74 SID79
                                              <MULTIPOLYGON [m]> <int> <dbl> <dbl>
  1 (((-9069486 4332928, -9077065 4338195, -9079419 4338345, -9…     1     1     0
  2 (((-9043563 4351024, -9043652 4352966, -9046118 4356510, -9…     2     0     3
  3 (((-8956336 4334060, -8958567 4335740, -8965302 4336017, -8…     3     5     6
  4 (((-8461242 4344697, -8462174 4347203, -8463903 4346960, -8…     4     1     2
  5 (((-8595797 4333842, -8597684 4330201, -8604809 4329777, -8…     5     9     3
  6 (((-8543186 4332866, -8569416 4332359, -8570982 4333096, -8…     6     7     5
  > 
  > # test st_set_crs in pipe:
  > sfc = st_sfc(st_point(c(0,0)), st_point(c(1,1)))
  > x <- sfc %>% st_set_crs(4326) %>% st_transform(3857)
  > x
  Geometry set for 2 features 
  Geometry type: POINT
  Dimension:     XY
  Bounding box:  xmin: 0 ymin: 0 xmax: 111319.5 ymax: 111325.1
  Projected CRS: WGS 84 / Pseudo-Mercator
  POINT (0 0)
  POINT (111319.5 111325.1)
  > 
  > read_sf(system.file("shape/nc.shp", package="sf"), quiet = TRUE) %>%
  + 	st_transform(3857) -> nc
  > nc.merc <- st_transform(nc, 32119) # NC State Plane
  > suppressPackageStartupMessages(library(units))
  > install_unit("person")
  > person = as_units("person")
  > nc.merc <- nc.merc %>% mutate(area = st_area(nc.merc), dens = BIR74 * person / area)
  > 
  > # summary(nc.merc$dens) # requires units 0.4-2
  > nc.merc$area_cl <- cut(nc$AREA, c(0, .1, .12, .15, .25))
  > nc.grp <- nc.merc %>% group_by(area_cl)
  > 
  > out <- nc.grp %>% summarise(A = sum(area), pop = sum(dens * area), 
  + 	new_dens = sum(dens * area)/sum(area)) 
  > 
  > # mean densities depend on grouping:
  > nc.merc %>% summarize(mean(dens))
  Simple feature collection with 1 feature and 1 field
  Geometry type: MULTIPOLYGON
  Dimension:     XY
  Bounding box:  xmin: 123829.8 ymin: 14740.06 xmax: 930518.6 ymax: 318255.5
  Projected CRS: NAD83 / North Carolina
  # A tibble: 1 × 2
    `mean(dens)`                                                          geometry
    [person/m^2]                                                <MULTIPOLYGON [m]>
  1   0.00000259 (((138426.9 177702.5, 145549.4 177840.1, 151052 180560.3, 152246…
  > out %>% summarise(mean(new_dens))
  Simple feature collection with 1 feature and 1 field
  Geometry type: MULTIPOLYGON
  Dimension:     XY
  Bounding box:  xmin: 123829.8 ymin: 14740.06 xmax: 930518.6 ymax: 318255.5
  Projected CRS: NAD83 / North Carolina
  # A tibble: 1 × 2
    `mean(new_dens)`                                                      geometry
        [person/m^2]                                            <MULTIPOLYGON [m]>
  1       0.00000259 (((154399.6 148902.2, 142570.2 149411.2, 123829.8 150485.1, …
  > 
  > # total densities don't:
  > nc.merc %>% summarise(sum(area * dens))
  Simple feature collection with 1 feature and 1 field
  Geometry type: MULTIPOLYGON
  Dimension:     XY
  Bounding box:  xmin: 123829.8 ymin: 14740.06 xmax: 930518.6 ymax: 318255.5
  Projected CRS: NAD83 / North Carolina
  # A tibble: 1 × 2
    `sum(area * dens)`                                                    geometry
              [person]                                          <MULTIPOLYGON [m]>
  1             329962 (((138426.9 177702.5, 145549.4 177840.1, 151052 180560.3, …
  > out %>% summarise(sum(A * new_dens))
  Simple feature collection with 1 feature and 1 field
  Geometry type: MULTIPOLYGON
  Dimension:     XY
  Bounding box:  xmin: 123829.8 ymin: 14740.06 xmax: 930518.6 ymax: 318255.5
  Projected CRS: NAD83 / North Carolina
  # A tibble: 1 × 2
    `sum(A * new_dens)`                                                   geometry
               [person]                                         <MULTIPOLYGON [m]>
  1              329962 (((154399.6 148902.2, 142570.2 149411.2, 123829.8 150485.…
  > 
  > conn = system.file("gpkg/nc.gpkg", package = "sf")
  > 
  > library(DBI)
  > library(RSQLite)
  Error in library(RSQLite) : there is no package called 'RSQLite'
  Execution halted
Running the tests in ‘tests/sfc.R’ failed.
Complete output:
  > suppressPackageStartupMessages(library(sf))
  > library(testthat)
  > 
  > p = st_point(c(1/3,1/6))
  > st_sfc(p, precision = 1000)
  Geometry set for 1 feature 
  Geometry type: POINT
  Dimension:     XY
  Bounding box:  xmin: 0.3333333 ymin: 0.1666667 xmax: 0.3333333 ymax: 0.1666667
  CRS:           NA
  Precision:     1000 
  POINT (0.3333333 0.1666667)
  > st_as_sfc(st_as_binary(st_sfc(p, precision = 0L)))
  Geometry set for 1 feature 
  Geometry type: POINT
  Dimension:     XY
  Bounding box:  xmin: 0.3333333 ymin: 0.1666667 xmax: 0.3333333 ymax: 0.1666667
  CRS:           NA
  POINT (0.3333333 0.1666667)
  > st_as_sfc(st_as_binary(st_sfc(p, precision = 1000)))
  Geometry set for 1 feature 
  Geometry type: POINT
  Dimension:     XY
  Bounding box:  xmin: 0.333 ymin: 0.167 xmax: 0.333 ymax: 0.167
  CRS:           NA
  POINT (0.333 0.167)
  > st_as_sfc(st_as_binary(st_sfc(p, precision = 1000000)))
  Geometry set for 1 feature 
  Geometry type: POINT
  Dimension:     XY
  Bounding box:  xmin: 0.333333 ymin: 0.166667 xmax: 0.333333 ymax: 0.166667
  CRS:           NA
  POINT (0.333333 0.166667)
  > st_as_sfc(st_as_binary(st_sfc(p, precision = 10L)))
  Geometry set for 1 feature 
  Geometry type: POINT
  Dimension:     XY
  Bounding box:  xmin: 0.3 ymin: 0.2 xmax: 0.3 ymax: 0.2
  CRS:           NA
  POINT (0.3 0.2)
  > st_as_sfc(st_as_binary(st_sfc(p, precision = -1)))
  Geometry set for 1 feature 
  Geometry type: POINT
  Dimension:     XY
  Bounding box:  xmin: 0.3333333 ymin: 0.1666667 xmax: 0.3333333 ymax: 0.1666667
  CRS:           NA
  POINT (0.3333333 0.1666667)
  > 
  > d = data.frame(a = 1:2)
  > d$geom = c("POINT(0 0)", "POINT(1 1)")
  > 
  > st_as_sf(d, wkt = "geom")
  Simple feature collection with 2 features and 1 field
  Geometry type: POINT
  Dimension:     XY
  Bounding box:  xmin: 0 ymin: 0 xmax: 1 ymax: 1
  CRS:           NA
    a        geom
  1 1 POINT (0 0)
  2 2 POINT (1 1)
  > st_as_sf(d, wkt = 2)
  Simple feature collection with 2 features and 1 field
  Geometry type: POINT
  Dimension:     XY
  Bounding box:  xmin: 0 ymin: 0 xmax: 1 ymax: 1
  CRS:           NA
    a        geom
  1 1 POINT (0 0)
  2 2 POINT (1 1)
  > st_as_sf(d, wkt = "geom", remove = FALSE)
  Simple feature collection with 2 features and 2 fields
  Geometry type: POINT
  Dimension:     XY
  Bounding box:  xmin: 0 ymin: 0 xmax: 1 ymax: 1
  CRS:           NA
    a       geom    geometry
  1 1 POINT(0 0) POINT (0 0)
  2 2 POINT(1 1) POINT (1 1)
  > 
  > st_as_sfc(c("POINT(0 0)", "POINT(1 1)"))
  Geometry set for 2 features 
  Geometry type: POINT
  Dimension:     XY
  Bounding box:  xmin: 0 ymin: 0 xmax: 1 ymax: 1
  CRS:           NA
  POINT (0 0)
  POINT (1 1)
  > st_as_sfc(c("POINT(0 0)", "POINT(1 1)", "POLYGON((0 0,1 1,0 1,0 0))"))
  Geometry set for 3 features 
  Geometry type: GEOMETRY
  Dimension:     XY
  Bounding box:  xmin: 0 ymin: 0 xmax: 1 ymax: 1
  CRS:           NA
  POINT (0 0)
  POINT (1 1)
  POLYGON ((0 0, 1 1, 0 1, 0 0))
  > st_as_sfc(character(0))
  Geometry set for 0 features 
  Bounding box:  xmin: NA ymin: NA xmax: NA ymax: NA
  CRS:           NA
  > x = st_as_sfc(character(0), 4326)
  > y = st_as_sfc(character(0), crs = 4326)
  > all.equal(x, y)
  [1] TRUE
  > st_as_sfc(c("POINT(0 0)", "POINT(1 1)", "POLYGON((0 0,1 1,0 1,0 0))"),
  + 	"+proj=longlat +datum=WGS84")
  Geometry set for 3 features 
  Geometry type: GEOMETRY
  Dimension:     XY
  Bounding box:  xmin: 0 ymin: 0 xmax: 1 ymax: 1
  CRS:           +proj=longlat +datum=WGS84
  POINT (0 0)
  POINT (1 1)
  POLYGON ((0 0, 1 1, 0 1, 0 0))
  > dg = st_as_sf(d, wkt = "geom")
  > print(dg, n = 1)
  Simple feature collection with 2 features and 1 field
  Geometry type: POINT
  Dimension:     XY
  Bounding box:  xmin: 0 ymin: 0 xmax: 1 ymax: 1
  CRS:           NA
  First 1 features:
    a        geom
  1 1 POINT (0 0)
  > head(st_as_sf(d, wkt = "geom"), 1)
  Simple feature collection with 1 feature and 1 field
  Geometry type: POINT
  Dimension:     XY
  Bounding box:  xmin: 0 ymin: 0 xmax: 0 ymax: 0
  CRS:           NA
    a        geom
  1 1 POINT (0 0)
  > 
  > d$geom = st_as_sfc(d$geom)
  > d1 = d
  > attr(d1, "sf_col") = "geom"
  > st_geometry(d1) = d$geom
  > 
  > d$geometry = d$geom # second geometry list-column
  > expect_warning(st_geometry(d) <- d$geom)
  > d
  Simple feature collection with 2 features and 1 field
  Active geometry column: geom
  Geometry type: POINT
  Dimension:     XY
  Bounding box:  xmin: 0 ymin: 0 xmax: 1 ymax: 1
  CRS:           NA
    a        geom    geometry
  1 1 POINT (0 0) POINT (0 0)
  2 2 POINT (1 1) POINT (1 1)
  > 
  > x = st_sfc(list(st_point(0:1), st_point(0:1)), crs = 4326)
  > # don't warn when replacing crs with identical value:
  > st_sfc(x, crs = 4326)
  Geometry set for 2 features 
  Geometry type: POINT
  Dimension:     XY
  Bounding box:  xmin: 0 ymin: 1 xmax: 0 ymax: 1
  Geodetic CRS:  WGS 84
  POINT (0 1)
  POINT (0 1)
  > y = st_sfc(x, crs = "+proj=longlat +datum=WGS84 +no_defs")
  > # but do when it changes:
  > y = st_sfc(x, crs = 3857)
  Warning message:
  st_crs<- : replacing crs does not reproject data; use st_transform for that 
  > 
  > p = st_point(0:1)
  > st_cast(p, "MULTIPOINT")
  MULTIPOINT ((0 1))
  > mp = st_multipoint(rbind(c(0,1), c(2,2)))
  > st_cast(mp, "POINT")
  POINT (0 1)
  Warning message:
  In st_cast.MULTIPOINT(mp, "POINT") : point from first coordinate only
  > st_cast(mp, "MULTIPOINT")
  MULTIPOINT ((0 1), (2 2))
  > 
  > # geometry collection to its elements:
  > st_cast(st_geometrycollection(list(mp)), "POINT")
  POINT (0 1)
  Warning message:
  In st_cast.MULTIPOINT(x[[1]], to, ...) : point from first coordinate only
  > st_cast(st_geometrycollection(list(mp)), "MULTIPOINT")
  MULTIPOINT ((0 1), (2 2))
  > st_cast(st_geometrycollection(list(p,mp)), "MULTIPOINT")
  MULTIPOINT ((0 1))
  Warning message:
  In st_cast.GEOMETRYCOLLECTION(st_geometrycollection(list(p, mp)),  :
    only first part of geometrycollection is retained
  > 
  > mp = st_multipoint(rbind(c(0,1)))
  > x = st_sfc(p, mp)
  > st_cast(x, "POINT")
  Geometry set for 2 features 
  Geometry type: POINT
  Dimension:     XY
  Bounding box:  xmin: 0 ymin: 1 xmax: 0 ymax: 1
  CRS:           NA
  POINT (0 1)
  POINT (0 1)
  Warning message:
  In st_cast.MULTIPOINT(X[[i]], ...) : point from first coordinate only
  > 
  > sf = st_sf(a = 3:2, geom = x)
  > st_cast(sf, "POINT")
  Simple feature collection with 2 features and 1 field
  Geometry type: POINT
  Dimension:     XY
  Bounding box:  xmin: 0 ymin: 1 xmax: 0 ymax: 1
  CRS:           NA
    a        geom
  1 3 POINT (0 1)
  2 2 POINT (0 1)
  Warning message:
  In st_cast.MULTIPOINT(X[[i]], ...) : point from first coordinate only
  > 
  > suppressPackageStartupMessages( library(dplyr) )
  > 
  > x %>% st_cast("POINT")
  Geometry set for 2 features 
  Geometry type: POINT
  Dimension:     XY
  Bounding box:  xmin: 0 ymin: 1 xmax: 0 ymax: 1
  CRS:           NA
  POINT (0 1)
  POINT (0 1)
  Warning message:
  In st_cast.MULTIPOINT(X[[i]], ...) : point from first coordinate only
  > 
  > # points:
  > mp = st_multipoint(rbind(c(0,1))) # single-point multipoint
  > st_sfc(p,mp) %>% st_cast("POINT")
  Geometry set for 2 features 
  Geometry type: POINT
  Dimension:     XY
  Bounding box:  xmin: 0 ymin: 1 xmax: 0 ymax: 1
  CRS:           NA
  POINT (0 1)
  POINT (0 1)
  Warning message:
  In st_cast.MULTIPOINT(X[[i]], ...) : point from first coordinate only
  > st_sfc(p,mp) %>% st_cast("MULTIPOINT")
  Geometry set for 2 features 
  Geometry type: MULTIPOINT
  Dimension:     XY
  Bounding box:  xmin: 0 ymin: 1 xmax: 0 ymax: 1
  CRS:           NA
  MULTIPOINT ((0 1))
  MULTIPOINT ((0 1))
  > 
  > # lines:
  > pts = rbind(c(0,0), c(1,1), c(2,1))
  > st_sfc(st_linestring(pts), st_multilinestring(list(pts))) %>% st_cast("LINESTRING")
  Geometry set for 2 features 
  Geometry type: LINESTRING
  Dimension:     XY
  Bounding box:  xmin: 0 ymin: 0 xmax: 2 ymax: 1
  CRS:           NA
  LINESTRING (0 0, 1 1, 2 1)
  LINESTRING (0 0, 1 1, 2 1)
  > st_sfc(st_linestring(pts), st_multilinestring(list(pts))) %>% st_cast("MULTILINESTRING")
  Geometry set for 2 features 
  Geometry type: MULTILINESTRING
  Dimension:     XY
  Bounding box:  xmin: 0 ymin: 0 xmax: 2 ymax: 1
  CRS:           NA
  MULTILINESTRING ((0 0, 1 1, 2 1))
  MULTILINESTRING ((0 0, 1 1, 2 1))
  > 
  > # polygons:
  > pts = rbind(c(0,0), c(1,1), c(0,1), c(0,0))
  > st_sfc(st_polygon(list(pts)), st_multipolygon(list(list(pts)))) %>% st_cast("POLYGON")
  Geometry set for 2 features 
  Geometry type: POLYGON
  Dimension:     XY
  Bounding box:  xmin: 0 ymin: 0 xmax: 1 ymax: 1
  CRS:           NA
  POLYGON ((0 0, 1 1, 0 1, 0 0))
  POLYGON ((0 0, 1 1, 0 1, 0 0))
  > st_sfc(st_polygon(list(pts)), st_multipolygon(list(list(pts)))) %>% st_cast("MULTIPOLYGON")
  Geometry set for 2 features 
  Geometry type: MULTIPOLYGON
  Dimension:     XY
  Bounding box:  xmin: 0 ymin: 0 xmax: 1 ymax: 1
  CRS:           NA
  MULTIPOLYGON (((0 0, 1 1, 0 1, 0 0)))
  MULTIPOLYGON (((0 0, 1 1, 0 1, 0 0)))
  > 
  > 
  > st_sfc(st_geometrycollection(list(p)), st_geometrycollection(list(mp))) %>% st_cast()
  Geometry set for 2 features 
  Geometry type: GEOMETRY
  Dimension:     XY
  Bounding box:  xmin: 0 ymin: 1 xmax: 0 ymax: 1
  CRS:           NA
  POINT (0 1)
  MULTIPOINT ((0 1))
  > st_sfc(st_geometrycollection(list(p)), st_geometrycollection(list(mp))) %>%
  + 	st_cast() %>%
  + 	st_cast("POINT")
  Geometry set for 2 features 
  Geometry type: POINT
  Dimension:     XY
  Bounding box:  xmin: 0 ymin: 1 xmax: 0 ymax: 1
  CRS:           NA
  POINT (0 1)
  POINT (0 1)
  Warning message:
  In st_cast.MULTIPOINT(X[[i]], ...) : point from first coordinate only
  > 
  > p = rbind(c(0,0),c(1,0),c(1,1),c(0,1),c(0,0))
  > pol = st_polygon(list(p))
  > # plot(pol)
  > try(plot(st_polygonize(pol))) # --> breaks
  Error in st_polygonize.sfc(st_sfc(x)) : 
    inherits(x, "sfc_LINESTRING") || inherits(x, "sfc_MULTILINESTRING") is not TRUE
  > st_length(st_sfc(st_point(c(0,0))))
  [1] 0
  > 
  > try(as(st_sfc(st_linestring(matrix(1:9,3))), "Spatial"))
  Error in StopZ(zm) : 
    sp supports Z dimension only for POINT and MULTIPOINT.
  use `st_zm(...)` to coerce to XY dimensions
  > 
  > # check conus is present:
  > x = st_sfc(st_point(c(-90,35)), st_point(c(-80,36)),
  + 	crs = "+proj=longlat +datum=NAD27")
  > y = st_transform(x, 3857)
  > 
  > sf_extSoftVersion()[1:3]
      GEOS     GDAL   proj.4 
  "3.10.2"  "3.4.2"  "9.0.0" 
  > 
  > # Ops.sfc:
  > ls = st_sfc(st_linestring(rbind(c(0,0),c(0,1))))
  > ls * 2
  Geometry set for 1 feature 
  Geometry type: LINESTRING
  Dimension:     XY
  Bounding box:  xmin: 0 ymin: 0 xmax: 0 ymax: 2
  CRS:           NA
  LINESTRING (0 0, 0 2)
  > ls - 2
  Geometry set for 1 feature 
  Geometry type: LINESTRING
  Dimension:     XY
  Bounding box:  xmin: -2 ymin: -2 xmax: -2 ymax: -1
  CRS:           NA
  LINESTRING (-2 -2, -2 -1)
  > (ls + 2) %% 3
  Geometry set for 1 feature 
  Geometry type: LINESTRING
  Dimension:     XY
  Bounding box:  xmin: 2 ymin: 0 xmax: 2 ymax: 2
  CRS:           NA
  LINESTRING (2 2, 2 0)
  > ls / ls
  Geometry set for 1 feature  (with 1 geometry empty)
  Geometry type: GEOMETRYCOLLECTION
  Dimension:     XY
  Bounding box:  xmin: NA ymin: NA xmax: NA ymax: NA
  CRS:           NA
  GEOMETRYCOLLECTION EMPTY
  > p_ = st_point(0:1)
  > ll = st_sfc(ls[[1]], p_)
  > ll & st_sfc(p_)
  Geometry set for 2 features 
  Geometry type: POINT
  Dimension:     XY
  Bounding box:  xmin: 0 ymin: 1 xmax: 0 ymax: 1
  CRS:           NA
  POINT (0 1)
  POINT (0 1)
  > ll | st_sfc(p_)
  Geometry set for 2 features 
  Geometry type: GEOMETRY
  Dimension:     XY
  Bounding box:  xmin: 0 ymin: 0 xmax: 0 ymax: 1
  CRS:           NA
  LINESTRING (0 0, 0 1)
  POINT (0 1)
  > ll %/% st_sfc(p_)
  Geometry set for 2 features  (with 1 geometry empty)
  Geometry type: GEOMETRY
  Dimension:     XY
  Bounding box:  xmin: 0 ymin: 0 xmax: 0 ymax: 1
  CRS:           NA
  LINESTRING (0 0, 0 1)
  GEOMETRYCOLLECTION EMPTY
  > ll == st_sfc(p_)
  [1] FALSE  TRUE
  > ll != st_sfc(p_)
  [1]  TRUE FALSE
  > 
  > 
  > str(x)
  sfc_POINT of length 2; first list element:  'XY' num [1:2] -90 35
  > nc = st_read(system.file("shape/nc.shp", package="sf"), quiet = TRUE)
  > str(nc)
  Classes 'sf' and 'data.frame':	100 obs. of  15 variables:
   $ AREA     : num  0.114 0.061 0.143 0.07 0.153 0.097 0.062 0.091 0.118 0.124 ...
   $ PERIMETER: num  1.44 1.23 1.63 2.97 2.21 ...
   $ CNTY_    : num  1825 1827 1828 1831 1832 ...
   $ CNTY_ID  : num  1825 1827 1828 1831 1832 ...
   $ NAME     : chr  "Ashe" "Alleghany" "Surry" "Currituck" ...
   $ FIPS     : chr  "37009" "37005" "37171" "37053" ...
   $ FIPSNO   : num  37009 37005 37171 37053 37131 ...
   $ CRESS_ID : int  5 3 86 27 66 46 15 37 93 85 ...
   $ BIR74    : num  1091 487 3188 508 1421 ...
   $ SID74    : num  1 0 5 1 9 7 0 0 4 1 ...
   $ NWBIR74  : num  10 10 208 123 1066 ...
   $ BIR79    : num  1364 542 3616 830 1606 ...
   $ SID79    : num  0 3 6 2 3 5 2 2 2 5 ...
   $ NWBIR79  : num  19 12 260 145 1197 ...
   $ geometry :sfc_MULTIPOLYGON of length 100; first list element: List of 1
    ..$ :List of 1
    .. ..$ : num [1:27, 1:2] -81.5 -81.5 -81.6 -81.6 -81.7 ...
    ..- attr(*, "class")= chr [1:3] "XY" "MULTIPOLYGON" "sfg"
   - attr(*, "sf_column")= chr "geometry"
   - attr(*, "agr")= Factor w/ 3 levels "constant","aggregate",..: NA NA NA NA NA NA NA NA NA NA ...
    ..- attr(*, "names")= chr [1:14] "AREA" "PERIMETER" "CNTY_" "CNTY_ID" ...
  > bb = st_as_sfc(st_bbox(nc))
  > format(st_bbox(nc))
  [1] "((-84.32385,33.88199),(-75.45698,36.58965))"
  > 
  > st_agr("constant")
  [1] constant
  Levels: constant aggregate identity
  > st_agr()
  [1] <NA>
  Levels: constant aggregate identity
  > x <- st_sf(a = 1:2, b = 3:4, geom = x, agr = c("constant", "aggregate"))
  > suppressPackageStartupMessages(library(dplyr))
  > y <- x %>% st_set_agr("constant")
  > y
  Simple feature collection with 2 features and 2 fields
  Attribute-geometry relationship: 2 constant, 0 aggregate, 0 identity
  Geometry type: POINT
  Dimension:     XY
  Bounding box:  xmin: -90 ymin: 35 xmax: -80 ymax: 36
  CRS:           +proj=longlat +datum=NAD27
    a b           geom
  1 1 3 POINT (-90 35)
  2 2 4 POINT (-80 36)
  > 
  > sf1 <- st_sf(a = c("x", "y"), geom = st_sfc(st_point(3:4), st_point(3:4)))
  > sf1[names(sf1)]
  Simple feature collection with 2 features and 1 field
  Geometry type: POINT
  Dimension:     XY
  Bounding box:  xmin: 3 ymin: 4 xmax: 3 ymax: 4
  CRS:           NA
    a        geom
  1 x POINT (3 4)
  2 y POINT (3 4)
  > 
  > st_bbox(sf1)
  xmin ymin xmax ymax 
     3    4    3    4 
  > bb = st_bbox(nc)
  > bb
       xmin      ymin      xmax      ymax 
  -84.32385  33.88199 -75.45698  36.58965 
  > st_crs(bb)
  Coordinate Reference System:
    User input: NAD27 
    wkt:
  GEOGCRS["NAD27",
      DATUM["North American Datum 1927",
          ELLIPSOID["Clarke 1866",6378206.4,294.978698213898,
              LENGTHUNIT["metre",1]]],
      PRIMEM["Greenwich",0,
          ANGLEUNIT["degree",0.0174532925199433]],
      CS[ellipsoidal,2],
          AXIS["latitude",north,
              ORDER[1],
              ANGLEUNIT["degree",0.0174532925199433]],
          AXIS["longitude",east,
              ORDER[2],
              ANGLEUNIT["degree",0.0174532925199433]],
      ID["EPSG",4267]]
  > st_bbox(c(xmin = 16.1, xmax = 16.6, ymin = 48.6, ymax = 47.9), crs = st_crs(4326))
  xmin ymin xmax ymax 
  16.1 48.6 16.6 47.9 
  > st_bbox(c(xmin = 16.1, xmax = 16.6, ymin = 48.6, ymax = 47.9), crs = 4326)
  xmin ymin xmax ymax 
  16.1 48.6 16.6 47.9 
  > 
  > bb$xrange
       xmin      xmax 
  -84.32385 -75.45698 
  > bb$yrange
      ymin     ymax 
  33.88199 36.58965 
  > bb$xmin
       xmin 
  -84.32385 
  > bb$ymin
      ymin 
  33.88199 
  > bb$xmax
       xmax 
  -75.45698 
  > bb$ymax
      ymax 
  36.58965 
  > try(bb$foo)
  Error in `$.bbox`(bb, foo) : unsupported name
  > 
  > # merge:
  > a = data.frame(a = 1:3, b = 5:7)
  > st_geometry(a) = st_sfc(st_point(c(0,0)), st_point(c(1,1)), st_point(c(2,2)))
  > b = data.frame(x = c("a", "b", "c"), b = c(2,5,6))
  > merge(a, b)
  Simple feature collection with 2 features and 3 fields
  Geometry type: POINT
  Dimension:     XY
  Bounding box:  xmin: 0 ymin: 0 xmax: 1 ymax: 1
  CRS:           NA
    b a x    geometry
  1 5 1 b POINT (0 0)
  2 6 2 c POINT (1 1)
  > merge(a, b, all = TRUE)
  Simple feature collection with 4 features and 3 fields (with 1 geometry empty)
  Geometry type: GEOMETRY
  Dimension:     XY
  Bounding box:  xmin: 0 ymin: 0 xmax: 2 ymax: 2
  CRS:           NA
    b  a    x                 geometry
  1 2 NA    a GEOMETRYCOLLECTION EMPTY
  2 5  1    b              POINT (0 0)
  3 6  2    c              POINT (1 1)
  4 7  3 <NA>              POINT (2 2)
  > 
  > # joins:
  > inner_join(a, b)
  Joining, by = "b"
  Simple feature collection with 2 features and 3 fields
  Geometry type: POINT
  Dimension:     XY
  Bounding box:  xmin: 0 ymin: 0 xmax: 1 ymax: 1
  CRS:           NA
    a b x    geometry
  1 1 5 b POINT (0 0)
  2 2 6 c POINT (1 1)
  > left_join(a, b)
  Joining, by = "b"
  Simple feature collection with 3 features and 3 fields
  Geometry type: POINT
  Dimension:     XY
  Bounding box:  xmin: 0 ymin: 0 xmax: 2 ymax: 2
  CRS:           NA
    a b    x    geometry
  1 1 5    b POINT (0 0)
  2 2 6    c POINT (1 1)
  3 3 7 <NA> POINT (2 2)
  > right_join(a, b)
  Joining, by = "b"
  Simple feature collection with 3 features and 3 fields (with 1 geometry empty)
  Geometry type: POINT
  Dimension:     XY
  Bounding box:  xmin: 0 ymin: 0 xmax: 1 ymax: 1
  CRS:           NA
     a b x    geometry
  1  1 5 b POINT (0 0)
  2  2 6 c POINT (1 1)
  3 NA 2 a POINT EMPTY
  > full_join(a, b)
  Joining, by = "b"
  Simple feature collection with 4 features and 3 fields (with 1 geometry empty)
  Geometry type: POINT
  Dimension:     XY
  Bounding box:  xmin: 0 ymin: 0 xmax: 2 ymax: 2
  CRS:           NA
     a b    x    geometry
  1  1 5    b POINT (0 0)
  2  2 6    c POINT (1 1)
  3  3 7 <NA> POINT (2 2)
  4 NA 2    a POINT EMPTY
  > semi_join(a, b)
  Joining, by = "b"
  Simple feature collection with 2 features and 2 fields
  Geometry type: POINT
  Dimension:     XY
  Bounding box:  xmin: 0 ymin: 0 xmax: 1 ymax: 1
  CRS:           NA
    a b    geometry
  1 1 5 POINT (0 0)
  2 2 6 POINT (1 1)
  > anti_join(a, b)
  Joining, by = "b"
  Simple feature collection with 1 feature and 2 fields
  Geometry type: POINT
  Dimension:     XY
  Bounding box:  xmin: 2 ymin: 2 xmax: 2 ymax: 2
  CRS:           NA
    a b    geometry
  1 3 7 POINT (2 2)
  > left_join(a, data.frame(b, geometry = 1), by = "b")
  Simple feature collection with 3 features and 4 fields
  Geometry type: POINT
  Dimension:     XY
  Bounding box:  xmin: 0 ymin: 0 xmax: 2 ymax: 2
  CRS:           NA
    a b    x geometry.y  geometry.x
  1 1 5    b          1 POINT (0 0)
  2 2 6    c          1 POINT (1 1)
  3 3 7 <NA>         NA POINT (2 2)
  > 
  > # st_joins:
  > a = st_sf(a = 1:3,
  +  geom = st_sfc(st_point(c(1,1)), st_point(c(2,2)), st_point(c(3,3))))
  > b = st_sf(a = 11:14,
  +  geom = st_sfc(st_point(c(10,10)), st_point(c(2,2)), st_point(c(2,2)), st_point(c(3,3))))
  > st_join(a, b)
  Simple feature collection with 4 features and 2 fields
  Geometry type: POINT
  Dimension:     XY
  Bounding box:  xmin: 1 ymin: 1 xmax: 3 ymax: 3
  CRS:           NA
      a.x a.y        geom
  1     1  NA POINT (1 1)
  2     2  12 POINT (2 2)
  2.1   2  13 POINT (2 2)
  3     3  14 POINT (3 3)
  > st_join(a, b, left = FALSE)
  Simple feature collection with 3 features and 2 fields
  Geometry type: POINT
  Dimension:     XY
  Bounding box:  xmin: 2 ymin: 2 xmax: 3 ymax: 3
  CRS:           NA
      a.x a.y        geom
  2     2  12 POINT (2 2)
  2.1   2  13 POINT (2 2)
  3     3  14 POINT (3 3)
  > # st_join, largest = TRUE:
  > nc <- st_transform(st_read(system.file("shape/nc.shp", package="sf"), quiet = TRUE), 2264)
  > gr = st_sf(
  +     label = apply(expand.grid(1:10, LETTERS[10:1])[,2:1], 1, paste0, collapse = " "),
  + 	geom = st_make_grid(st_as_sfc(st_bbox(nc))))
  > gr$col = sf.colors(10, categorical = TRUE, alpha = .3)
  > # cut, to check, NA's work out:
  > gr = gr[-(1:30),]
  > st_join(nc, gr, largest = TRUE)
  Simple feature collection with 100 features and 16 fields
  Geometry type: MULTIPOLYGON
  Dimension:     XY
  Bounding box:  xmin: 406265 ymin: 48359.7 xmax: 3052877 ymax: 1044143
  Projected CRS: NAD83 / North Carolina (ftUS)
  First 10 features:
      AREA PERIMETER CNTY_ CNTY_ID        NAME  FIPS FIPSNO CRESS_ID BIR74 SID74
  1  0.114     1.442  1825    1825        Ashe 37009  37009        5  1091     1
  2  0.061     1.231  1827    1827   Alleghany 37005  37005        3   487     0
  3  0.143     1.630  1828    1828       Surry 37171  37171       86  3188     5
  4  0.070     2.968  1831    1831   Currituck 37053  37053       27   508     1
  5  0.153     2.206  1832    1832 Northampton 37131  37131       66  1421     9
  6  0.097     1.670  1833    1833    Hertford 37091  37091       46  1452     7
  7  0.062     1.547  1834    1834      Camden 37029  37029       15   286     0
  8  0.091     1.284  1835    1835       Gates 37073  37073       37   420     0
  9  0.118     1.421  1836    1836      Warren 37185  37185       93   968     4
  10 0.124     1.428  1837    1837      Stokes 37169  37169       85  1612     1
     NWBIR74 BIR79 SID79 NWBIR79 label       col                       geometry
  1       10  1364     0      19  A  4 #fb80724d MULTIPOLYGON (((1270813 913...
  2       10   542     3      12  A  4 #fb80724d MULTIPOLYGON (((1340553 959...
  3      208  3616     6     260  A  5 #80b1d34d MULTIPOLYGON (((1570586 910...
  4      123   830     2     145  A 10 #bc80bd4d MULTIPOLYGON (((2881206 948...
  5     1066  1606     3    1197  A  8 #fccde54d MULTIPOLYGON (((2525700 911...
  6      954  1838     5    1237  A  9 #d9d9d94d MULTIPOLYGON (((2665112 911...
  7      115   350     2     139  A 10 #bc80bd4d MULTIPOLYGON (((2881206 948...
  8      254   594     2     371  A  9 #d9d9d94d MULTIPOLYGON (((2717988 951...
  9      748  1190     2     844  A  8 #fccde54d MULTIPOLYGON (((2203888 914...
  10     160  2038     5     176  A  5 #80b1d34d MULTIPOLYGON (((1697618 911...
  Warning message:
  attribute variables are assumed to be spatially constant throughout all geometries 
  > 
  > # rbind:
  > x = st_sf(a = 1:2, geom = st_sfc(list(st_point(0:1), st_point(0:1)), crs = 4326))
  > rbind(x, x, x)
  Simple feature collection with 6 features and 1 field
  Geometry type: POINT
  Dimension:     XY
  Bounding box:  xmin: 0 ymin: 1 xmax: 0 ymax: 1
  Geodetic CRS:  WGS 84
    a        geom
  1 1 POINT (0 1)
  2 2 POINT (0 1)
  3 1 POINT (0 1)
  4 2 POINT (0 1)
  5 1 POINT (0 1)
  6 2 POINT (0 1)
  > nc2 = rbind(nc[1:50, ], nc[51:100, ])
  > all.equal(nc, nc2)
  [1] TRUE
  > 
  > # st_sample:
  > suppressWarnings(RNGversion("3.5.3"))
  > set.seed(131)
  > options(digits=6)
  > x = st_sfc(st_polygon(list(rbind(c(0,1),c(90,1),c(90,90),c(0,90),c(0,1)))), crs = st_crs(4326))
  >   (p <- st_sample(x, 10))
  Geometry set for 10 features 
  Geometry type: POINT
  Dimension:     XY
  Bounding box:  xmin: 11.2448 ymin: 3.16385 xmax: 82.3451 ymax: 60.1703
  Geodetic CRS:  WGS 84
  First 5 geometries:
  POINT (18.5793 25.2416)
  POINT (11.2448 20.8596)
  POINT (26.3946 60.1703)
  POINT (33.8202 19.146)
  POINT (76.1712 32.1029)
  >   p <- st_sample(x[[1]], 10) # sfg method
  > x = st_sfc(st_polygon(list(rbind(c(0,0),c(90,0),c(90,90),c(0,90),c(0,0))))) # NOT long/lat:
  > p <- st_sample(x, 10)
  > x = st_sfc(st_polygon(list(rbind(c(-180,-90),c(180,-90),c(180,90),c(-180,90),c(-180,-90)))),
  +  crs=st_crs(4326))
  > #FIXME:
  > # if (sf_extSoftVersion()["proj.4"] >= "4.9.0") # lwgeom breaks on this
  > #   (p <- st_sample(x, 10))
  > pt = st_multipoint(matrix(1:20,,2))
  > st_sample(p, 3)
  Geometry set for 1 feature 
  Geometry type: MULTIPOINT
  Dimension:     XY
  Bounding box:  xmin: 41.0557 ymin: 27.8024 xmax: 80.9558 ymax: 65.5424
  CRS:           NA
  MULTIPOINT ((57.2118 52.329), (80.9558 65.5424)...
  > try(st_sample(p, 3.3))
  Geometry set for 1 feature 
  Geometry type: MULTIPOINT
  Dimension:     XY
  Bounding box:  xmin: 19.3415 ymin: 9.17624 xmax: 80.9558 ymax: 65.5424
  CRS:           NA
  MULTIPOINT ((19.3415 18.6622), (57.1389 9.17624...
  Warning message:
  In st_sample.sfc(p, 3.3) : size is not an integer
  > ls = st_sfc(st_linestring(rbind(c(0,0),c(0,1))),
  +  st_linestring(rbind(c(0,0),c(.1,0))),
  +  st_linestring(rbind(c(0,1),c(.1,1))),
  +  st_linestring(rbind(c(2,2),c(2,2.00001))))
  > st_sample(ls, 80)
  Geometry set for 4 features  (with 1 geometry empty)
  Geometry type: MULTIPOINT
  Dimension:     XY
  Bounding box:  xmin: 0 ymin: 0 xmax: 0.0914728 ymax: 1
  CRS:           NA
  MULTIPOINT ((0 0.137868), (0 0.777635), (0 0.40...
  MULTIPOINT ((0.0914728 0), (0.073852 0), (0.003...
  MULTIPOINT ((0.0488222 1), (0.0716508 1), (0.08...
  MULTIPOINT EMPTY
  > st_sample(nc[1:2,], size = c(10,20))
  Geometry set for 30 features 
  Geometry type: POINT
  Dimension:     XY
  Bounding box:  xmin: 1216510 ymin: 935852 xmax: 1428880 ymax: 1031490
  Projected CRS: NAD83 / North Carolina (ftUS)
  First 5 geometries:
  POINT (1264558 935852)
  POINT (1256623 949369)
  POINT (1222665 972624)
  POINT (1333528 968263)
  POINT (1310837 958630)
  > # try with LINES, LongLat, should generate a warning:
  > nc[1:2,] %>% st_transform(4326) %>% st_cast("MULTILINESTRING") %>% st_sample(size = c(10,20))
  although coordinates are longitude/latitude, st_sample assumes that they are planar
  although coordinates are longitude/latitude, st_sample assumes that they are planar
  Geometry set for 2 features 
  Geometry type: MULTIPOINT
  Dimension:     XY
  Bounding box:  xmin: -81.6893 ymin: 36.2491 xmax: -80.914 ymax: 36.5726
  Geodetic CRS:  WGS 84
  MULTIPOINT ((-81.2401 36.3717), (-81.6893 36.36...
  MULTIPOINT ((-81.2629 36.4076), (-81.1375 36.56...
  > st_sample(ls, 80, type = "regular")
  Geometry set for 4 features  (with 1 geometry empty)
  Geometry type: MULTIPOINT
  Dimension:     XY
  Bounding box:  xmin: 0 ymin: 0 xmax: 0.095454 ymax: 1
  CRS:           NA
  MULTIPOINT ((0 0.0104441), (0 0.0254442), (0 0....
  MULTIPOINT ((0.000452334 0), (0.0154525 0), (0....
  MULTIPOINT ((0.00545321 1), (0.0204533 1), (0.0...
  MULTIPOINT EMPTY
  > p_sample = lapply(1:10, function(i) st_sample(nc[i, ], 100, exact = FALSE))
  > lengths(p_sample)
   [1] 104 106 110  96  98 120  87 105 104  99
  > p_sample_exact = lapply(1:10, function(i) st_sample(nc[i, ], 100, exact = TRUE))
  > lengths(p_sample_exact)
   [1] 100 100 100 100 100 100 100 100 100 100
  > #plot(nc$geometry[1])
  > #plot(p_sample[[1]], add = TRUE)
  > #plot(p_sample_exact[[1]], add = TRUE)
  > 
  > #class(st_bind_cols(nc, as.data.frame(nc)[1:3]))
  > class(dplyr::bind_cols(nc, as.data.frame(nc)[1:3]))
  New names:
  • `AREA` -> `AREA...1`
  • `PERIMETER` -> `PERIMETER...2`
  • `CNTY_` -> `CNTY_...3`
  • `AREA` -> `AREA...16`
  • `PERIMETER` -> `PERIMETER...17`
  • `CNTY_` -> `CNTY_...18`
  [1] "sf"         "data.frame"
  > class(rbind(nc, nc))
  [1] "sf"         "data.frame"
  > class(cbind(nc, nc))
  [1] "sf"         "data.frame"
  > 
  > x = st_sfc(st_point(0:1), st_point(2:3))
  > x[c(NA,1,NA,2,NA)]
  Geometry set for 5 features  (with 3 geometries empty)
  Geometry type: POINT
  Dimension:     XY
  Bounding box:  xmin: 0 ymin: 1 xmax: 2 ymax: 3
  CRS:           NA
  POINT EMPTY
  POINT (0 1)
  POINT EMPTY
  POINT (2 3)
  POINT EMPTY
  > 
  > # jitter
  > pts = st_centroid(st_geometry(nc))
  > plot(pts)
  > plot(st_jitter(pts, .05), add = TRUE, col = 'red')
  > plot(st_geometry(nc))
  > plot(st_jitter(st_geometry(nc), factor = .01), add = TRUE, col = '#ff8888')
  > st_jitter(st_sfc(st_point(0:1)), amount = .1)
  Geometry set for 1 feature 
  Geometry type: POINT
  Dimension:     XY
  Bounding box:  xmin: -0.0500922 ymin: 0.992953 xmax: -0.0500922 ymax: 0.992953
  CRS:           NA
  POINT (-0.0500922 0.992953)
  > 
  > # st_bbox:
  > library(sp)
  > demo(meuse, ask = FALSE, echo = FALSE)
  > suppressWarnings(st_bbox(meuse))
    xmin   ymin   xmax   ymax 
  178605 329714 181390 333611 
  > crs = suppressWarnings(st_crs(meuse))
  > library(raster)
  Error in library(raster) : there is no package called 'raster'
  Execution halted
Running the tests in ‘tests/spatstat.R’ failed.
Complete output:
  > suppressPackageStartupMessages(library(spatstat.random))
  Error in library(spatstat.random) : 
    there is no package called 'spatstat.random'
  Calls: suppressPackageStartupMessages -> withCallingHandlers -> library
  Execution halted
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > library(testthat)
  > suppressPackageStartupMessages(library(sf))
  > 
  > test_check("sf")
  Coordinate Reference System:
    User input: EPSG:4326 
    wkt:
  GEOGCRS["WGS 84",
      ENSEMBLE["World Geodetic System 1984 ensemble",
          MEMBER["World Geodetic System 1984 (Transit)"],
          MEMBER["World Geodetic System 1984 (G730)"],
          MEMBER["World Geodetic System 1984 (G873)"],
          MEMBER["World Geodetic System 1984 (G1150)"],
          MEMBER["World Geodetic System 1984 (G1674)"],
          MEMBER["World Geodetic System 1984 (G1762)"],
          MEMBER["World Geodetic System 1984 (G2139)"],
          ELLIPSOID["WGS 84",6378137,298.257223563,
              LENGTHUNIT["metre",1]],
          ENSEMBLEACCURACY[2.0]],
      PRIMEM["Greenwich",0,
          ANGLEUNIT["degree",0.0174532925199433]],
      CS[ellipsoidal,2],
          AXIS["geodetic latitude (Lat)",north,
              ORDER[1],
              ANGLEUNIT["degree",0.0174532925199433]],
          AXIS["geodetic longitude (Lon)",east,
              ORDER[2],
              ANGLEUNIT["degree",0.0174532925199433]],
      USAGE[
          SCOPE["Horizontal component of 3D system."],
          AREA["World."],
          BBOX[-90,-180,90,180]],
      ID["EPSG",4326]]
  Coordinate Reference System:
    No user input
    wkt:
  GEOGCRS["WGS 84",
      ENSEMBLE["World Geodetic System 1984 ensemble",
          MEMBER["World Geodetic System 1984 (Transit)"],
          MEMBER["World Geodetic System 1984 (G730)"],
          MEMBER["World Geodetic System 1984 (G873)"],
          MEMBER["World Geodetic System 1984 (G1150)"],
          MEMBER["World Geodetic System 1984 (G1674)"],
          MEMBER["World Geodetic System 1984 (G1762)"],
          MEMBER["World Geodetic System 1984 (G2139)"],
          ELLIPSOID["WGS 84",6378137,298.257223563,
              LENGTHUNIT["metre",1]],
          ENSEMBLEACCURACY[2.0]],
      PRIMEM["Greenwich",0,
          ANGLEUNIT["degree",0.0174532925199433]],
      CS[ellipsoidal,2],
          AXIS["geodetic latitude (Lat)",north,
              ORDER[1],
              ANGLEUNIT["degree",0.0174532925199433]],
          AXIS["geodetic longitude (Lon)",east,
              ORDER[2],
              ANGLEUNIT["degree",0.0174532925199433]],
      USAGE[
          SCOPE["Horizontal component of 3D system."],
          AREA["World."],
          BBOX[-90,-180,90,180]],
      ID["EPSG",4326]]
  Cannot open layer foo
  Reading layer `nospatial' from data source 
    `/home/hornik/tmp/R.check/r-devel-gcc/Work/build/Packages/sf/gpkg/nospatial.gpkg' 
    using driver `GPKG'
  Reading layer `nospatial' from data source 
    `/home/hornik/tmp/R.check/r-devel-gcc/Work/build/Packages/sf/gpkg/nospatial.gpkg' 
    using driver `GPKG'
  OGR: Unsupported geometry type
  Failed to create feature 1 in x
  Failed to create feature 1 in x
  [ FAIL 1 | WARN 12 | SKIP 18 | PASS 694 ]
  
  ══ Skipped tests ═══════════════════════════════════════════════════════════════
  • !sf_use_s2() is not TRUE (1)
  • RPostgres cannot be loaded (3)
  • Sys.getenv("USER") %in% c("edzer", "travis") is not TRUE (3)
  • empty test (6)
  • sf_extSoftVersion()[["GDAL"]] < "2.5.0" && sf_extSoftVersion()[["proj.4"]] <  (1)
  • sf_extSoftVersion()[["GDAL"]] < "2.5.0" is not TRUE (1)
  • sf_extSoftVersion()[["proj.4"]] < "6.0.0" is not TRUE (3)
  
  ══ Failed tests ════════════════════════════════════════════════════════════════
  ── Error (test_crs.R:108:3): crs.Raster works ──────────────────────────────────
  <packageNotFoundError/error/condition>
  Error in `library(raster)`: there is no package called 'raster'
  Backtrace:
      ▆
   1. └─base::library(raster) at test_crs.R:108:2
  
  [ FAIL 1 | WARN 12 | SKIP 18 | PASS 694 ]
  Error: Test failures
  Execution halted