Running ‘aggregate.R’
  Comparing ‘aggregate.Rout’ to ‘aggregate.Rout.save’ ...4c4
< Linking to GEOS 3.7.1, GDAL 2.3.2, PROJ 5.2.0
---
> Linking to GEOS 3.6.1, GDAL 2.2.3, PROJ 4.9.3
  Running ‘cast.R’
  Comparing ‘cast.Rout’ to ‘cast.Rout.save’ ... OK
  Running ‘crs.R’
  Running ‘dist.R’
  Running ‘dplyr.R’ [10s/11s]
  Comparing ‘dplyr.Rout’ to ‘dplyr.Rout.save’ ...77,80c77,80
< 1 (0,0.1]          0.0760 (((-8678517 4054264, -8679088 4061405, -8680136 40615…
< 2 (0.1,0.12]       0.112  (((-9383227 4192541, -9375980 4199500, -9370835 41966…
< 3 (0.12,0.1…       0.134  (((-8520830 4108031, -8522040 4111119, -8520104 41115…
< 4 (0.15,0.2…       0.190  (((-8532272 4151181, -8529886 4149052, -8543756 41433…
---
> 1 (0,0.1]          0.0760 (((-8678517 4054264, -8679088 4061405, -8680136 40615~
> 2 (0.1,0.12]       0.112  (((-9383227 4192541, -9375980 4199500, -9370835 41966~
> 3 (0.12,0.1~       0.134  (((-8520830 4108031, -8522040 4111119, -8520104 41115~
> 4 (0.15,0.2~       0.190  (((-8532272 4151181, -8529886 4149052, -8543756 41433~
109,114c109,114
< 1    95 (((-8588146 4131923, -8589850 4133303, -8589356 4135198, -8… SID79     4
< 2    96 (((-8711999 4081959, -8719511 4077863, -8731642 4078864, -8… SID79     5
< 3    97 (((-8685774 4073056, -8697387 4077823, -8700120 4077570, -8… SID79     3
< 4    98 (((-8755885 4021935, -8802506 4069795, -8798771 4071779, -8… SID79    17
< 5    99 (((-8678517 4054264, -8679088 4061405, -8680136 4061550, -8… SID79     9
< 6   100 (((-8755885 4021935, -8753548 4025868, -8753052 4030195, -8… SID79     6
---
> 1    95 (((-8588146 4131923, -8589850 4133303, -8589356 4135198, -8~ SID79     4
> 2    96 (((-8711999 4081959, -8719511 4077863, -8731642 4078864, -8~ SID79     5
> 3    97 (((-8685774 4073056, -8697387 4077823, -8700120 4077570, -8~ SID79     3
> 4    98 (((-8755885 4021935, -8802506 4069795, -8798771 4071779, -8~ SID79    17
> 5    99 (((-8678517 4054264, -8679088 4061405, -8680136 4061550, -8~ SID79     9
> 6   100 (((-8755885 4021935, -8753548 4025868, -8753052 4030195, -8~ SID79     6
124,129c124,129
< 1     1 (((-9069486 4332934, -9077066 4338201, -9079419 4338351, -9…     1     0
< 2     2 (((-9043562 4351030, -9043652 4352973, -9046117 4356516, -9…     0     3
< 3     3 (((-8956335 4334068, -8958566 4335747, -8965300 4336025, -8…     5     6
< 4     4 (((-8461241 4344709, -8462173 4347214, -8463902 4346972, -8…     1     2
< 5     5 (((-8595797 4333852, -8597683 4330212, -8604808 4329788, -8…     9     3
< 6     6 (((-8543185 4332878, -8569416 4332369, -8570981 4333107, -8…     7     5
---
> 1     1 (((-9069486 4332934, -9077066 4338201, -9079419 4338351, -9~     1     0
> 2     2 (((-9043562 4351030, -9043652 4352973, -9046117 4356516, -9~     0     3
> 3     3 (((-8956335 4334068, -8958566 4335747, -8965300 4336025, -8~     5     6
> 4     4 (((-8461241 4344709, -8462173 4347214, -8463902 4346972, -8~     1     2
> 5     5 (((-8595797 4333852, -8597683 4330212, -8604808 4329788, -8~     9     3
> 6     6 (((-8543185 4332878, -8569416 4332369, -8570981 4333107, -8~     7     5
139,144c139,144
< 1 (((-9069486 4332934, -9077066 4338201, -9079419 4338351, -9…     1     1     0
< 2 (((-9043562 4351030, -9043652 4352973, -9046117 4356516, -9…     2     0     3
< 3 (((-8956335 4334068, -8958566 4335747, -8965300 4336025, -8…     3     5     6
< 4 (((-8461241 4344709, -8462173 4347214, -8463902 4346972, -8…     4     1     2
< 5 (((-8595797 4333852, -8597683 4330212, -8604808 4329788, -8…     5     9     3
< 6 (((-8543185 4332878, -8569416 4332369, -8570981 4333107, -8…     6     7     5
---
> 1 (((-9069486 4332934, -9077066 4338201, -9079419 4338351, -9~     1     1     0
> 2 (((-9043562 4351030, -9043652 4352973, -9046117 4356516, -9~     2     0     3
> 3 (((-8956335 4334068, -8958566 4335747, -8965300 4336025, -8~     3     5     6
> 4 (((-8461241 4344709, -8462173 4347214, -8463902 4346972, -8~     4     1     2
> 5 (((-8595797 4333852, -8597683 4330212, -8604808 4329788, -8~     5     9     3
> 6 (((-8543185 4332878, -8569416 4332369, -8570981 4333107, -8~     6     7     5
153c153
< bbox:           xmin: 0 ymin: 0 xmax: 111319.5 ymax: 111325.1
---
> bbox:           xmin: 0 ymin: -7.081155e-10 xmax: 111319.5 ymax: 111325.1
155c155
< POINT (0 0)
---
> POINT (0 -7.081155e-10)
183c183
< 1 2.593234e-06 (((834893.7 95747.49, 833834.2 98254.6, 835420.2 98655.72, 84006…
---
> 1 2.593234e-06 (((834893.7 95747.49, 833834.2 98254.6, 835420.2 98655.72, 84006~
193c193
< 1     2.589362e-06 (((834893.7 95747.49, 833834.2 98254.6, 835420.2 98655.72, 8…
---
> 1     2.589362e-06 (((834893.7 95747.49, 833834.2 98254.6, 835420.2 98655.72, 8~
205c205
< 1             329962 (((834893.7 95747.49, 833834.2 98254.6, 835420.2 98655.72,…
---
> 1             329962 (((834893.7 95747.49, 833834.2 98254.6, 835420.2 98655.72,~
213c213
<   `sum(A * new_dens…                                                    geometry
---
>   `sum(A * new_dens~                                                    geometry
215c215
< 1             329962 (((834893.7 95747.49, 833834.2 98254.6, 835420.2 98655.72,…
---
> 1             329962 (((834893.7 95747.49, 833834.2 98254.6, 835420.2 98655.72,~
  Running ‘empty.R’
  Comparing ‘empty.Rout’ to ‘empty.Rout.save’ ... OK
  Running ‘gdal_geom.R’
  Running ‘geos.R’
  Running ‘graticule.R’
  Comparing ‘graticule.Rout’ to ‘graticule.Rout.save’ ... OK
  Running ‘grid.R’
  Comparing ‘grid.Rout’ to ‘grid.Rout.save’ ... OK
  Running ‘maps.R’
  Comparing ‘maps.Rout’ to ‘maps.Rout.save’ ... OK
  Running ‘plot.R’ [13s/14s]
  Comparing ‘plot.Rout’ to ‘plot.Rout.save’ ... OK
  Running ‘read.R’
  Comparing ‘read.Rout’ to ‘read.Rout.save’ ...246c246
< Integer64 values larger than 9.0072e+15 lost significance after conversion to double;
---
> Integer64 values larger than 9.0072e+015 lost significance after conversion to double;
284c284
< 2 POINT (367470.5 4962414)
---
> 2 POINT (367470.5 4962415)
328c328
< Reading layer `tst__' from data source `/data/gannet/ripley/R/packages/tests-devel/sf.Rcheck/tests/tst__.gpkg' using driver `GPKG'
---
> Reading layer `tst__' from data source `d:\RCompile\CRANguest\R-devel\sf.Rcheck\tests_x64\tst__.gpkg' using driver `GPKG'
  Running ‘roundtrip.R’ [10s/11s]
  Comparing ‘roundtrip.Rout’ to ‘roundtrip.Rout.save’ ...145c145
< Reading layer `nc.gpkg' from data source `/data/gannet/ripley/R/packages/tests-devel/sf.Rcheck/sf/gpkg/nc.gpkg' using driver `GPKG'
---
> Reading layer `nc.gpkg' from data source `D:\temp\Rtmpm8We6c\RLIBS_2f0d4562c4d7e\sf\gpkg\nc.gpkg' using driver `GPKG'
  Running ‘sample.R’
  Comparing ‘sample.Rout’ to ‘sample.Rout.save’ ... OK
  Running ‘sfc.R’
  Running ‘sfg.R’
  Comparing ‘sfg.Rout’ to ‘sfg.Rout.save’ ... OK
  Running ‘spatstat.R’
  Comparing ‘spatstat.Rout’ to ‘spatstat.Rout.save’ ...198c198
< Reading layer `nc.gpkg' from data source `/data/gannet/ripley/R/packages/tests-devel/sf.Rcheck/sf/gpkg/nc.gpkg' using driver `GPKG'
---
> Reading layer `nc.gpkg' from data source `D:\temp\Rtmpm8We6c\RLIBS_2f0d4562c4d7e\sf\gpkg\nc.gpkg' using driver `GPKG'
  Running ‘stars.R’
  Comparing ‘stars.Rout’ to ‘stars.Rout.save’ ...79,81c79,196
< 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
> bbox:           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
> bbox:           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
> bbox:           xmin: 1 ymin: 1 xmax: 5 ymax: 4
> CRS:            +proj=longlat +datum=WGS84 +no_defs 
> 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
> bbox:           xmin: 0.5 ymin: 0.5 xmax: 5.5 ymax: 4.5
> CRS:            +proj=longlat +datum=WGS84 +no_defs 
> 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...
> Reading layer `nc.gpkg' from data source `D:\temp\Rtmpm8We6c\RLIBS_2f0d4562c4d7e\sf\gpkg\nc.gpkg' using driver `GPKG'
> Simple feature collection with 100 features and 14 fields
> Attribute-geometry relationship: 0 constant, 8 aggregate, 6 identity
> geometry type:  MULTIPOLYGON
> dimension:      XY
> bbox:           xmin: -84.32385 ymin: 33.88199 xmax: -75.45698 ymax: 36.58965
> CRS:            4267
> stars object with 2 dimensions and 1 attribute
> attribute(s):
>      AREA       
>  Min.   :0.042  
>  1st Qu.:0.108  
>  Median :0.142  
>  Mean   :0.145  
>  3rd Qu.:0.181  
>  Max.   :0.241  
>  NA's   :30904  
> dimension(s):
>   from  to   offset      delta refsys point values    
> x    1 461 -84.3239  0.0192484     NA FALSE   NULL [x]
> y    1 141  36.5896 -0.0192484     NA FALSE   NULL [y]
> Simple feature collection with 34097 features and 1 field
> geometry type:  POLYGON
> dimension:      XY
> bbox:           xmin: -84.32385 ymin: 33.87563 xmax: -75.45034 ymax: 36.58965
> CRS:            NA
> First 10 features:
>     AREA                       geometry
> 1  0.114 POLYGON ((-81.66757 36.5896...
> 2  0.114 POLYGON ((-81.64833 36.5896...
> 3  0.114 POLYGON ((-81.62908 36.5896...
> 4  0.114 POLYGON ((-81.60983 36.5896...
> 5  0.114 POLYGON ((-81.59058 36.5896...
> 6  0.114 POLYGON ((-81.57133 36.5896...
> 7  0.114 POLYGON ((-81.55208 36.5896...
> 8  0.114 POLYGON ((-81.53283 36.5896...
> 9  0.114 POLYGON ((-81.51359 36.5896...
> 10 0.114 POLYGON ((-81.49434 36.5896...
> Simple feature collection with 34097 features and 1 field
> geometry type:  POLYGON
> dimension:      XY
> bbox:           xmin: -84.32385 ymin: 33.87563 xmax: -75.45034 ymax: 36.58965
> CRS:            NA
> First 10 features:
>     AREA                       geometry
> 1  0.114 POLYGON ((-81.66757 36.5896...
> 2  0.114 POLYGON ((-81.64833 36.5896...
> 3  0.114 POLYGON ((-81.62908 36.5896...
> 4  0.114 POLYGON ((-81.60983 36.5896...
> 5  0.114 POLYGON ((-81.59058 36.5896...
> 6  0.114 POLYGON ((-81.57133 36.5896...
> 7  0.114 POLYGON ((-81.55208 36.5896...
> 8  0.114 POLYGON ((-81.53283 36.5896...
> 9  0.114 POLYGON ((-81.51359 36.5896...
> 10 0.114 POLYGON ((-81.49434 36.5896...
> Simple feature collection with 34097 features and 1 field
> geometry type:  POINT
> dimension:      XY
> bbox:           xmin: -84.31423 ymin: 33.88525 xmax: -75.45997 ymax: 36.58003
> CRS:            NA
> First 10 features:
>     AREA                   geometry
> 1  0.114 POINT (-81.65795 36.58003)
> 2  0.114  POINT (-81.6387 36.58003)
> 3  0.114 POINT (-81.61945 36.58003)
> 4  0.114  POINT (-81.6002 36.58003)
> 5  0.114 POINT (-81.58096 36.58003)
> 6  0.114 POINT (-81.56171 36.58003)
> 7  0.114 POINT (-81.54246 36.58003)
> 8  0.114 POINT (-81.52321 36.58003)
> 9  0.114 POINT (-81.50396 36.58003)
> 10 0.114 POINT (-81.48471 36.58003)
  Running ‘testthat.R’ [13s/15s]
  Running ‘units.R’
  Comparing ‘units.Rout’ to ‘units.Rout.save’ ... OK
  Running ‘wkb.R’
  Comparing ‘wkb.Rout’ to ‘wkb.Rout.save’ ... OK
Running the tests in ‘tests/crs.R’ failed.
Complete output:
  > suppressPackageStartupMessages(library(sf))
  > suppressWarnings(st_crs(-1))
  Coordinate Reference System: NA
  > suppressWarnings(st_crs(999999))
  Coordinate Reference System: NA
  > inherits(try(st_crs("error"), silent = TRUE), "try-error")
  [1] TRUE
  > str = "+proj=sterea +lat_0=52.15616055555555 +lon_0=5.38763888888889 +k=0.9999079 +x_0=155000 +y_0=463000 +ellps=bessel +towgs84=565.4171,50.3319,465.5524,-0.398957388243134,0.343987817378283,-1.87740163998045,4.0725 +units=m +no_defs"
  > x <- st_crs(str)
  > x<- st_crs(3857)
  > str = st_crs(3857)$proj4string
  > st_crs(3857)$units
  [1] "m"
  > x = st_crs("+proj=longlat +datum=WGS84")
  > x = st_crs(4326)
  > x = st_crs("+proj=laea") # no EPSG
  > 
  > x = st_sfc(st_point(0:1))
  > y = st_crs(x, parameters = TRUE)
  > st_crs(x) = 4326
  > y = st_crs(x, parameters = TRUE)
  > 
  > from = st_crs(4326)$proj4string
  > to = st_crs(3857)$proj4string
  > ret = sf_project(from, to, rbind(c(0,0), c(1,1)))
  > round(ret, 7)
           [,1]     [,2]
  [1,]      0.0      0.0
  [2,] 111319.5 111325.1
  > # create Inf points: #1227/#1228
  > suppressWarnings(
  +   sf_project("+proj=longlat", "+proj=lcc +lat_1=30 +lat_2=60", cbind(c(0,0),c(-80,-90)), keep = TRUE)
  + )
       [,1]      [,2]
  [1,]    0 -53554590
  [2,]   NA        NA
  > sf_project(to, from, ret)
       [,1] [,2]
  [1,]    0    0
  [2,]    1    1
  > suppressWarnings(
  +   sf_project("+proj=longlat", "+proj=lcc +lat_1=30 +lat_2=60", cbind(c(0,0),c(-80,-90)), keep = TRUE)
  + )
       [,1]      [,2]
  [1,]    0 -53554590
  [2,]   NA        NA
  > st_transform(st_sfc(st_point(c(0,0)), st_point(c(1,1)), crs = 4326), 3857)
  Geometry set for 2 features 
  geometry type:  POINT
  dimension:      XY
  bbox:           xmin: 0 ymin: 0 xmax: 111319.5 ymax: 111325.1
  CRS:            EPSG:3857
  POINT (0 0)
  POINT (111319.5 111325.1)
  > if (Sys.getenv("USER") %in% c("edzer", "travis")) { # causes memory leaks:
  +   stopifnot(inherits(try(sf_project("+proj=longlat", "+proj=bar", matrix(1:4,2)), silent = TRUE), "try-error"))
  +   stopifnot(inherits(try(sf_project("+proj=foo", "+proj=longlat", matrix(1:4,2)), silent = TRUE), "try-error"))
  + }
  > 
  > if (sf_extSoftVersion()["USE_PROJ_H"] == "true" || sf_proj_info("have_datum_files")) {
  +   "datum files installed"
  + } else {
  +   "datum files not installed"
  + }
  [1] "datum files installed"
  > 
  > x = st_crs(sp::CRS("+proj=longlat +ellps=WGS84 +no_defs"))
  > 
  > # https://github.com/r-spatial/sf/issues/1170
  > g = st_as_sfc("POLYGON ((-61.66957 10.69214, -61.565 10.75728, -61.37453 10.77654, -61.40721 10.60681, -61.66957 10.69214))")
  > d = st_as_sf(data.frame(id=1, geometry=g), crs=4326)
  > st_area(d)
  Error in st_area.sfc(st_geometry(x, ...)) : 
    package lwgeom required, please install it first
  Calls: st_area -> st_area.sf -> st_area -> st_area.sfc
  Execution halted
Running the tests in ‘tests/dist.R’ failed.
Complete output:
  > suppressPackageStartupMessages(library(sf))
  > library(sp)
  > suppressPackageStartupMessages(library(units))
  > 
  > x = st_sfc(
  + st_point(c(0,0)),
  + st_point(c(1,0)),
  + st_point(c(2,0)),
  + st_point(c(3,0)),
  + crs = 4326
  + )
  > 
  > y = st_sfc(
  + st_point(c(0,10)),
  + st_point(c(1,0)),
  + st_point(c(2,0)),
  + st_point(c(3,0)),
  + st_point(c(4,0)),
  + crs = 4326
  + )
  > 
  > d.sf = st_distance(x, y)
  Error in st_distance(x, y) : lwgeom required: install first?
  Execution halted
Running the tests in ‘tests/gdal_geom.R’ failed.
Complete output:
  > suppressPackageStartupMessages(library(sf))
  > 
  > nc = st_read(system.file("shape/nc.shp", package="sf"), "nc", crs = 4267,
  + 	agr = c(AREA = "aggregate", PERIMETER = "aggregate", CNTY_ = "identity",
  + 		CNTY_ID = "identity", NAME = "identity", FIPS = "identity", FIPSNO = "identity",
  + 		CRESS_ID = "identity", BIR74 = "aggregate", SID74 = "aggregate", NWBIR74 = "aggregate",
  + 		BIR79 = "aggregate", SID79 = "aggregate", NWBIR79  = "aggregate"), quiet = TRUE)
  > 
  > st_is_valid(nc)
    [1] TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE
   [16] TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE
   [31] TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE
   [46] TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE
   [61] TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE
   [76] TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE
   [91] TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE
  > 
  > st_is_simple(nc)
    [1] TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE
   [16] TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE
   [31] TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE
   [46] TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE
   [61] TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE
   [76] TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE
   [91] TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE
  > 
  > nc_tr = st_transform(nc, 3857)
  > 
  > x = st_buffer(nc_tr, 1000)
  > 
  > x = st_boundary(nc)
  > 
  > x = st_convex_hull(nc)
  > 
  > x = st_simplify(nc_tr, dTolerance = 1e4)
  > 
  > x = st_simplify(nc_tr, preserveTopology = TRUE)
  > 
  > if (sf:::CPL_geos_version() >= "3.4.0")
  + 	x = st_triangulate(nc_tr)
  > 
  > mls = st_multilinestring(list(matrix(c(0,0,0,1,1,1,0,0),,2,byrow=TRUE)))
  > x = st_polygonize(mls)
  > 
  > x = st_segmentize(nc_tr, 5e4)
  > 
  > try(x <- st_segmentize(nc_tr, -0.1))
  Error in CPL_gdal_segmentize(x, dfMaxLength) : 
    argument dfMaxLength should be positive
  
  > 
  > x = st_centroid(nc_tr)
  Warning message:
  In st_centroid.sf(nc_tr) :
    st_centroid assumes attributes are constant over geometries of x
  > x = st_point_on_surface(nc_tr)
  Warning message:
  In st_point_on_surface.sf(nc_tr) :
    st_point_on_surface assumes attributes are constant over geometries of x
  > 
  > a = nc[1:5,]
  > b = nc[4:10,]
  > 
  > x <- st_intersection(a[1,] ,b)
  although coordinates are longitude/latitude, st_intersection assumes that they are planar
  Warning message:
  attribute variables are assumed to be spatially constant throughout all geometries 
  > 
  > u = st_union(b) 
  > 
  > x <- st_intersection(st_geometry(a), st_geometry(u))
  although coordinates are longitude/latitude, st_intersection assumes that they are planar
  > 
  > x = st_union(a[1,], b)
  although coordinates are longitude/latitude, st_union assumes that they are planar
  Warning message:
  attribute variables are assumed to be spatially constant throughout all geometries 
  > 
  > x = st_union(a, st_union(b))
  although coordinates are longitude/latitude, st_union assumes that they are planar
  Warning message:
  attribute variables are assumed to be spatially constant throughout all geometries 
  > 
  > x = st_difference(a[1,], b)
  although coordinates are longitude/latitude, st_difference assumes that they are planar
  Warning message:
  attribute variables are assumed to be spatially constant throughout all geometries 
  > 
  > x = st_difference(a, st_union(b))
  although coordinates are longitude/latitude, st_difference assumes that they are planar
  Warning message:
  attribute variables are assumed to be spatially constant throughout all geometries 
  > 
  > x = st_sym_difference(a[1,], b)
  although coordinates are longitude/latitude, st_sym_difference assumes that they are planar
  Warning message:
  attribute variables are assumed to be spatially constant throughout all geometries 
  > 
  > x = st_sym_difference(a, st_union(b))
  although coordinates are longitude/latitude, st_sym_difference assumes that they are planar
  Warning message:
  attribute variables are assumed to be spatially constant throughout all geometries 
  > 
  > x = st_drivers()
  > #cat(paste("GDAL has", nrow(x), "drivers\n"))
  > 
  > # GEOS ops:
  > 
  > st_relate(a, b)
  although coordinates are longitude/latitude, st_relate assumes that they are planar
       [,1]        [,2]        [,3]        [,4]        [,5]        [,6]       
  [1,] "FF2FF1212" "FF2FF1212" "FF2FF1212" "FF2FF1212" "FF2FF1212" "FF2FF1212"
  [2,] "FF2FF1212" "FF2FF1212" "FF2FF1212" "FF2FF1212" "FF2FF1212" "FF2FF1212"
  [3,] "FF2FF1212" "FF2FF1212" "FF2FF1212" "FF2FF1212" "FF2FF1212" "FF2FF1212"
  [4,] "2FFF1FFF2" "FF2FF1212" "FF2FF1212" "FF2F11212" "FF2FF1212" "FF2FF1212"
  [5,] "FF2FF1212" "2FFF1FFF2" "FF2F11212" "FF2FF1212" "FF2FF1212" "FF2F11212"
       [,7]       
  [1,] "FF2FF1212"
  [2,] "FF2FF1212"
  [3,] "FF2F11212"
  [4,] "FF2FF1212"
  [5,] "FF2FF1212"
  > 
  > st_disjoint(a, b)
  although coordinates are longitude/latitude, st_intersects assumes that they are planar
  Sparse geometry binary predicate list of length 5, where the predicate was `disjoint'
   1: 1, 2, 3, 4, 5, 6, 7
   2: 1, 2, 3, 4, 5, 6, 7
   3: 1, 2, 3, 4, 5, 6
   4: 2, 3, 5, 6, 7
   5: 1, 4, 5, 7
  > 
  > st_touches(a, b)
  although coordinates are longitude/latitude, st_touches assumes that they are planar
  Sparse geometry binary predicate list of length 5, where the predicate was `touches'
   1: (empty)
   2: (empty)
   3: 7
   4: 4
   5: 3, 6
  > 
  > st_crosses(a, b)
  although coordinates are longitude/latitude, st_crosses assumes that they are planar
  Sparse geometry binary predicate list of length 5, where the predicate was `crosses'
   1: (empty)
   2: (empty)
   3: (empty)
   4: (empty)
   5: (empty)
  > 
  > st_within(a, b)
  although coordinates are longitude/latitude, st_within assumes that they are planar
  Sparse geometry binary predicate list of length 5, where the predicate was `within'
   1: (empty)
   2: (empty)
   3: (empty)
   4: 1
   5: 2
  > 
  > st_contains(a, b)
  although coordinates are longitude/latitude, st_contains assumes that they are planar
  Sparse geometry binary predicate list of length 5, where the predicate was `contains'
   1: (empty)
   2: (empty)
   3: (empty)
   4: 1
   5: 2
  > 
  > st_overlaps(a, b)
  although coordinates are longitude/latitude, st_overlaps assumes that they are planar
  Sparse geometry binary predicate list of length 5, where the predicate was `overlaps'
   1: (empty)
   2: (empty)
   3: (empty)
   4: (empty)
   5: (empty)
  > 
  > st_equals(a, b)
  Sparse geometry binary predicate list of length 5, where the predicate was `equals'
   1: (empty)
   2: (empty)
   3: (empty)
   4: 1
   5: 2
  > 
  > st_covers(a, b)
  although coordinates are longitude/latitude, st_covers assumes that they are planar
  Sparse geometry binary predicate list of length 5, where the predicate was `covers'
   1: (empty)
   2: (empty)
   3: (empty)
   4: 1
   5: 2
  > 
  > st_covered_by(a, b)
  although coordinates are longitude/latitude, st_covered_by assumes that they are planar
  Sparse geometry binary predicate list of length 5, where the predicate was `covered_by'
   1: (empty)
   2: (empty)
   3: (empty)
   4: 1
   5: 2
  > 
  > st_equals_exact(a, b, 0.01)
  Sparse geometry binary predicate list of length 5, where the predicate was `equals_exact'
   1: (empty)
   2: (empty)
   3: (empty)
   4: 1
   5: 2
  > 
  > # st_is_within_distance(a, b, 2)
  > 
  > st_geometry_type(st_sfc(st_point(1:2), st_linestring(matrix(1:4,2,2))))
  [1] POINT      LINESTRING
  18 Levels: GEOMETRY POINT LINESTRING POLYGON MULTIPOINT ... TRIANGLE
  > 
  > st_geometry_type(st_sfc(st_point(1:2), st_linestring(matrix(1:4,2,2))), by_geometry = FALSE)
  [1] GEOMETRY
  18 Levels: GEOMETRY POINT LINESTRING POLYGON MULTIPOINT ... TRIANGLE
  > 
  > st_zm(list(st_point(1:3), st_linestring(matrix(1:6,2,3))))
  [[1]]
  POINT (1 2)
  
  [[2]]
  LINESTRING (1 3, 2 4)
  
  > 
  > st_zm(list(st_point(1:2), st_linestring(matrix(1:6,3,2))), add = TRUE, "Z")
  [[1]]
  POINT (1 2)
  
  [[2]]
  LINESTRING (1 4, 2 5, 3 6)
  
  > 
  > st_transform(st_sfc(st_point(c(0,0)), crs=4326), st_crs("+proj=geocent"))[[1]]
  POINT Z (6378137 0 0)
  > 
  > cbind(st_area(nc_tr[1:5,]), a$AREA)
             [,1]  [,2]
  [1,] 1760244757 0.114
  [2,]  946435667 0.061
  [3,] 2202248253 0.143
  [4,] 1074351919 0.070
  [5,] 2352539533 0.153
  > 
  > st_area(st_polygon(list(rbind(c(0,0), c(1,0), c(1,1), c(0,1), c(0,0)))))
  [1] 1
  > 
  > st_length(st_linestring(rbind(c(0,0),c(0,1))))
  [1] 1
  > 
  > st_length(st_multilinestring(list(rbind(c(0,0),c(0,1)))))
  [1] 1
  > 
  > try(st_length(st_polygon(list(rbind(c(0,0), c(1,0), c(1,1), c(0,1), c(0,0))))))
  [1] 0
  > 
  > st_area(st_multilinestring(list(rbind(c(0,0),c(0,1)))))
  [1] 0
  > 
  > # adds the (0.5 0.5) node:
  > st_union(st_multilinestring(list(rbind(c(0,0),c(1,1)), rbind(c(0,1), c(1,0)))))
  MULTILINESTRING ((0 0, 1 1), (0 1, 1 0))
  > 
  > p1 = st_point(c(7,52))
  > p2 = st_point(c(-30,20))
  > sfc = st_sfc(p1, p2)
  > try(st_buffer(sfc, units::set_units(1000, km))) # error: no crs
  Error in st_buffer.sfc(sfc, units::set_units(1000, km)) : 
    x does not have a crs set: can't convert units
  > sfc = st_sfc(p1, p2, crs = 4326)
  > try(st_buffer(sfc, units::set_units(1000, km))) # error: wrong units
  Error : cannot convert km into °
  In addition: Warning message:
  In st_buffer.sfc(sfc, units::set_units(1000, km)) :
    st_buffer does not correctly buffer longitude/latitude data
  > if (version$os == "linux-gnu") { # FIXME: why does this break on windows - degree symbol?
  +   x = st_buffer(sfc, units::set_units(0.1, rad))      # OK: will convert to arc_degrees
  + }
  Warning message:
  In st_buffer.sfc(sfc, units::set_units(0.1, rad)) :
    st_buffer does not correctly buffer longitude/latitude data
  > x = st_transform(sfc, 3857)
  > x = st_buffer(x, units::set_units(1000, km)) # success
  > 
  > cr = st_as_sfc("CIRCULARSTRING(0 0,1 0,1 1)")
  > cr1 = st_sf(a = 1, geometry = cr)
  > plot(cr)
  > st_as_grob(cr[[1]])
  lines[GRID.lines.1] 
  > 
  > x = st_as_sfc("MULTISURFACE(CURVEPOLYGON(COMPOUNDCURVE(LINESTRING(-159.399779123 22.226016471, -159.399699153 22.226276431, -159.398736217 22.226118372, -159.398260872 22.226095318, -159.398140792 22.2260564590001, -159.398163058 22.2257268010001, -159.397882642 22.225394244, -159.397397157 22.225057335, -159.397318825 22.2251780230001, -159.396993115 22.225177984, -159.396748242 22.2248808800001, -159.396901679 22.224770398, -159.396876329 22.224673093, -159.399167008 22.224731392, -159.399502204 22.225551382), CIRCULARSTRING(-159.399502204 22.225551382, -159.399622762077 22.2257930044972, -159.399779123 22.226016471))))")
  > mp <- x[[1]] %>% st_cast("MULTIPOLYGON")
  > 
  > x = st_as_sfc("COMPOUNDCURVE(CIRCULARSTRING(0 0, 1 1, 1 0),(1 0, 0 1))")
  > ls <- x[[1]] %>% st_cast()
  > class(ls)
  [1] "XY"         "LINESTRING" "sfg"       
  > 
  > is.na(st_bbox(ls))
  [1] FALSE
  > 
  > mp = st_combine(st_buffer(st_sfc(lapply(1:3, function(x) st_point(c(x,x)))), 0.2 * 1:3))
  > plot(st_centroid(mp), add = TRUE, col = 'red') # centroid of combined geometry
  > plot(st_centroid(mp, of_largest_polygon = TRUE), add = TRUE, col = 'blue', pch = 3) # center of largest sub-polygon
  > 
  > x = st_sfc(st_polygon(list(rbind(c(0,0),c(0.5,0),c(0.5,0.5),c(0.5,0),c(1,0),c(1,1),c(0,1),c(0,0)))))
  > suppressWarnings(st_is_valid(x))
  [1] FALSE
  > y = st_make_valid(x)
  Error in st_make_valid.sfc(x) : lwgeom required: install that first
  Calls: st_make_valid -> st_make_valid.sfc
  Execution halted
Running the tests in ‘tests/geos.R’ failed.
Complete output:
  > suppressPackageStartupMessages(library(sf))
  > # nc = st_read(system.file("gpkg/nc.gpkg", package="sf"))
  > nc = st_read(system.file("shape/nc.shp", package="sf"), quiet = TRUE)
  > nc_checked = st_transform(nc, 32119, check = TRUE)
  > ncm = st_transform(nc, 32119)
  > 
  > x = st_transform(nc[1:10,], 32119)
  > st_distance(x)
  Units: [m]
             [,1]      [,2]      [,3]      [,4]      [,5]      [,6]     [,7]
   [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
             [,8]      [,9]     [,10]
   [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
  > 
  > st_is_valid(nc)
    [1] TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE
   [16] TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE
   [31] TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE
   [46] TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE
   [61] TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE
   [76] TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE
   [91] TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE
  > 
  > st_is_empty(st_sfc(st_point(), st_linestring()))
  [1] TRUE TRUE
  > 
  > ops = c("intersects", #"disjoint", 
  + "touches", "crosses", "within", "contains", "overlaps", "equals", "covers", "covered_by", "equals_exact")
  > for (op in ops) {
  + 	x = sf:::st_geos_binop(op, ncm[1:50,], ncm[51:100,], 0, NA_character_, FALSE)
  + 	x = sf:::st_geos_binop(op, ncm[1:50,], ncm[51:100,], 0, NA_character_, TRUE)
  + }
  > 
  > ops = c("intersects", #"disjoint", 
  + "touches", "crosses", "within", "contains", "overlaps", "covers", "covered_by")
  > df = data.frame(ops = ops)
  > df$equal = NA
  > for (op in ops)
  + 	df[df$ops == op, "equal"] = identical(
  + 		sf:::st_geos_binop(op, ncm[1:50,], ncm[51:100,], 0, NA_character_, TRUE, FALSE),
  + 		sf:::st_geos_binop(op, ncm[1:50,], ncm[51:100,], 0, NA_character_, TRUE,  TRUE)
  + 	)
  > df
           ops equal
  1 intersects  TRUE
  2    touches  TRUE
  3    crosses  TRUE
  4     within  TRUE
  5   contains  TRUE
  6   overlaps  TRUE
  7     covers  TRUE
  8 covered_by  TRUE
  > 
  > st_contains_properly(ncm[1:3,], ncm[1:3])
  Sparse geometry binary predicate list of length 3, where the predicate was `contains_properly'
   1: (empty)
   2: (empty)
   3: (empty)
  > 
  > st_combine(nc)
  Geometry set for 1 feature 
  geometry type:  MULTIPOLYGON
  dimension:      XY
  bbox:           xmin: -84.32385 ymin: 33.88199 xmax: -75.45698 ymax: 36.58965
  CRS:            4267
  MULTIPOLYGON (((-81.47276 36.23436, -81.54084 3...
  > 
  > st_dimension(st_sfc(st_point(0:1), st_linestring(rbind(c(0,0),c(1,1))), 
  + 	st_polygon(list(rbind(c(0,0), c(1,0), c(1,1), c(0,1), c(0,0))))))
  [1] 0 1 2
  > 
  > ncbb = st_as_sfc(st_bbox(nc))
  > g = st_make_grid(ncbb)
  although coordinates are longitude/latitude, st_relate_pattern assumes that they are planar
  > x = st_intersection(nc, g)
  although coordinates are longitude/latitude, st_intersection assumes that they are planar
  Warning message:
  attribute variables are assumed to be spatially constant throughout all geometries 
  > x = st_intersection(g, nc)
  although coordinates are longitude/latitude, st_intersection assumes that they are planar
  > 
  > ls = st_sfc(st_linestring(rbind(c(0,0),c(0,1))),
  + st_linestring(rbind(c(0,0),c(10,0))))
  > 
  > suppressWarnings(RNGversion("3.5.3"))
  > set.seed(13531)
  > 
  > st_line_sample(ls, density = 1, type = "random")
  Geometry set for 2 features 
  geometry type:  MULTIPOINT
  dimension:      XY
  bbox:           xmin: 0 ymin: 0 xmax: 6.880179 ymax: 0.8878369
  CRS:            NA
  MULTIPOINT ((0 0.8878369))
  MULTIPOINT ((0.2986488 0), (2.48417 0), (2.5678...
  > 
  > g = st_make_grid(ncbb, n = c(20,10))
  although coordinates are longitude/latitude, st_relate_pattern assumes that they are planar
  > 
  > a1 = st_interpolate_aw(nc["BIR74"], g, FALSE)
  although coordinates are longitude/latitude, st_intersection assumes that they are planar
  Error in st_area.sfc(st_geometry(x, ...)) : 
    package lwgeom required, please install it first
  Calls: st_interpolate_aw ... st_interpolate_aw.sf -> st_area -> st_area.sf -> st_area -> st_area.sfc
  In addition: Warning message:
  In st_interpolate_aw.sf(nc["BIR74"], g, FALSE) :
    st_interpolate_aw assumes attributes are constant over areas of x
  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
  bbox:           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
  bbox:           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
  bbox:           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
  bbox:           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
  bbox:           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
  bbox:           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
  bbox:           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
  bbox:           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
  bbox:           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
  bbox:           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
  bbox:           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 
  bbox:           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
  bbox:           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
  bbox:           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
  bbox:           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
  bbox:           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
  bbox:           xmin: 0 ymin: 1 xmax: 0 ymax: 1
  CRS:            EPSG:4326
  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
  bbox:           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
  bbox:           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
  bbox:           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
  bbox:           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
  bbox:           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
  bbox:           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
  bbox:           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
  bbox:           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
  bbox:           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
  bbox:           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
  bbox:           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.7.1" "2.3.2" "5.2.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
  bbox:           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
  bbox:           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
  bbox:           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
  bbox:           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
  bbox:           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
  bbox:           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
  bbox:           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
  bbox:           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
  bbox:           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: 4267 
    wkt:
  GEOGCS["NAD27",
      DATUM["North_American_Datum_1927",
          SPHEROID["Clarke 1866",6378206.4,294.9786982138982,
              AUTHORITY["EPSG","7008"]],
          AUTHORITY["EPSG","6267"]],
      PRIMEM["Greenwich",0,
          AUTHORITY["EPSG","8901"]],
      UNIT["degree",0.0174532925199433,
          AUTHORITY["EPSG","9122"]],
      AUTHORITY["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
  bbox:           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
  bbox:           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
  bbox:           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
  bbox:           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
  bbox:           xmin: 0 ymin: 0 xmax: 1 ymax: 1
  CRS:            NA
     a b x    geometry
  1 NA 2 a POINT EMPTY
  2  1 5 b POINT (0 0)
  3  2 6 c POINT (1 1)
  > 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
  bbox:           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
  bbox:           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
  bbox:           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
  bbox:           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
  bbox:           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
  bbox:           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")), 2264)
  Reading layer `nc' from data source `/data/gannet/ripley/R/packages/tests-devel/sf.Rcheck/sf/shape/nc.shp' using driver `ESRI Shapefile'
  Simple feature collection with 100 features and 14 fields
  geometry type:  MULTIPOLYGON
  dimension:      XY
  bbox:           xmin: -84.32385 ymin: 33.88199 xmax: -75.45698 ymax: 36.58965
  CRS:            4267
  > 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
  bbox:           xmin: 406262.2 ymin: 48374.87 xmax: 3052887 ymax: 1044158
  CRS:            EPSG:2264
  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 (((1270814 913...
  2       10   542     3      12  A  4 #fb80724d MULTIPOLYGON (((1340555 959...
  3      208  3616     6     260  A  5 #80b1d34d MULTIPOLYGON (((1570591 910...
  4      123   830     2     145  A 10 #bc80bd4d MULTIPOLYGON (((2881208 948...
  5     1066  1606     3    1197  A  8 #fccde54d MULTIPOLYGON (((2525701 911...
  6      954  1838     5    1237  A  9 #d9d9d94d MULTIPOLYGON (((2665113 911...
  7      115   350     2     139  A 10 #bc80bd4d MULTIPOLYGON (((2881208 948...
  8      254   594     2     371  A  9 #d9d9d94d MULTIPOLYGON (((2717989 951...
  9      748  1190     2     844  A  8 #fccde54d MULTIPOLYGON (((2203890 914...
  10     160  2038     5     176  A  5 #80b1d34d MULTIPOLYGON (((1697624 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
  bbox:           xmin: 0 ymin: 1 xmax: 0 ymax: 1
  CRS:            EPSG:4326
    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))
  > #if (sf_extSoftVersion()["proj.4"] >= "4.9.0")
  >   (p <- st_sample(x, 10))
  although coordinates are longitude/latitude, st_relate_pattern assumes that they are planar
  Error in st_area.sfc(st_make_grid(x, n = c(1, 1))) : 
    package lwgeom required, please install it first
  Calls: st_sample ... st_sample.sfc -> st_poly_sample -> st_area -> st_area.sfc
  Execution halted
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > library(testthat)
  > suppressPackageStartupMessages(library(sf))
  > 
  > test_check("sf")
  ── 1. Error: geos ops give warnings and errors on longlat (@test_geos.R#52)  ───
  package lwgeom required, please install it first
  Backtrace:
    1. testthat::expect_silent(st_segmentize(l, 1e+05))
   10. sf:::st_segmentize.sfc(l, 1e+05)
  
  ── 2. Error: st_area() works on GEOMETRY in longlat (#131) (@test_geos.R#79)  ──
  package lwgeom required, please install it first
  Backtrace:
    1. testthat::expect_silent(st_area(st_set_crs(w, 4326)))
   10. sf:::st_area.sfc(st_set_crs(w, 4326))
  
  Cannot open layer foo
  Reading layer `nospatial' from data source `/data/gannet/ripley/R/packages/tests-devel/sf.Rcheck/sf/gpkg/nospatial.gpkg' using driver `GPKG'
  Reading layer `nospatial' from data source `/data/gannet/ripley/R/packages/tests-devel/sf.Rcheck/sf/gpkg/nospatial.gpkg' using driver `GPKG'
  ── 3. Error: st_sample works (@test_sample.R#6)  ───────────────────────────────
  package lwgeom required, please install it first
  Backtrace:
   1. sf::st_sample(x = nc, size = n)
   2. sf:::st_sample.sf(x = nc, size = n)
   4. sf:::st_sample.sfc(st_geometry(x), size, ...)
   5. sf:::st_poly_sample(x, size = size, ..., type = type)
   7. sf:::st_area.sfc(st_make_grid(x, n = c(1, 1)))
  
  OGR: Unsupported geometry type
  Failed to create feature 1 in x
  Failed to create feature 1 in x
  ══ testthat results  ═══════════════════════════════════════════════════════════
  [ OK: 695 | SKIPPED: 55 | WARNINGS: 4 | FAILED: 3 ]
  1. Error: geos ops give warnings and errors on longlat (@test_geos.R#52) 
  2. Error: st_area() works on GEOMETRY in longlat (#131) (@test_geos.R#79) 
  3. Error: st_sample works (@test_sample.R#6) 
  
  Error: testthat unit tests failed
  Execution halted