Running ‘cast.R’
  Comparing ‘cast.Rout’ to ‘cast.Rout.save’ ...4c4
< Linking to GEOS 3.5.0, GDAL 2.0.2, proj.4 4.9.2
---
> Linking to GEOS 3.5.1, GDAL 2.1.3, proj.4 4.9.2
  Running ‘crs.R’
  Comparing ‘crs.Rout’ to ‘crs.Rout.save’ ...47c47
< [1] "+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"
---
> [1] "+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.398957,0.343988,-1.87740,4.0725 +units=m +no_defs"
57c57
< [1] "+proj=longlat +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +no_defs"
---
> [1] "+proj=longlat +datum=WGS84 +no_defs"
  Running ‘dist.R’
  Comparing ‘dist.Rout’ to ‘dist.Rout.save’ ...109c109
< MULTIPOINT(505.997685423939 -7.08115455161362e-...
---
> MULTIPOINT(505.997685423971 -7.08115455161362e-...
  Running ‘dplyr.R’ [6s/18s]
  Running ‘empty.R’
  Comparing ‘empty.Rout’ to ‘empty.Rout.save’ ... OK
  Running ‘gdal_geom.R’
  Comparing ‘gdal_geom.Rout’ to ‘gdal_geom.Rout.save’ ... OK
  Running ‘geos.R’ [9s/20s]
  Comparing ‘geos.Rout’ to ‘geos.Rout.save’ ... OK
  Running ‘graticule.R’
  Comparing ‘graticule.Rout’ to ‘graticule.Rout.save’ ... OK
  Running ‘grid.R’
  Comparing ‘grid.Rout’ to ‘grid.Rout.save’ ... OK
  Running ‘plot.R’ [19s/46s]
  Comparing ‘plot.Rout’ to ‘plot.Rout.save’ ... OK
  Running ‘read.R’
  Running ‘roundtrip.R’ [11s/27s]
  Comparing ‘roundtrip.Rout’ to ‘roundtrip.Rout.save’ ... OK
  Running ‘sfc.R’ [4s/11s]
  Comparing ‘sfc.Rout’ to ‘sfc.Rout.save’ ...125c125
< proj4string:    +proj=longlat +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +no_defs
---
> proj4string:    +proj=longlat +datum=WGS84 +no_defs
170c170
< proj4string:    +proj=longlat +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +no_defs
---
> proj4string:    +proj=longlat +datum=WGS84 +no_defs
173,174d172
< Warning message:
< st_crs<- : replacing crs does not reproject data; use st_transform for that 
347,348c345
< Error in st_polygonize.sfc(st_sfc(x)) : 
<   inherits(x, "sfc_LINESTRING") || inherits(x, "sfc_MULTILINESTRING") is not TRUE
---
> Error : inherits(x, "sfc_LINESTRING") || inherits(x, "sfc_MULTILINESTRING") is not TRUE
370c367
< "3.5.0" "2.0.2" "4.9.2" 
---
> "3.5.1" "2.1.3" "4.9.2" 
  Running ‘sfg.R’
  Comparing ‘sfg.Rout’ to ‘sfg.Rout.save’ ... OK
  Running ‘testthat.R’ [13s/33s]
  Comparing ‘testthat.Rout’ to ‘testthat.Rout.save’ ...9c9
< Reading layer `nc' from data source `/data/gannet/ripley/R/packages/tests-devel/sf.Rcheck/sf/shape/nc.shp' using driver `ESRI Shapefile'
---
> Reading layer `nc' from data source `/home/edzer/git/sf.Rcheck/sf/shape/nc.shp' using driver `ESRI Shapefile'
16c16
< Reading layer `nc' from data source `/data/gannet/ripley/R/packages/tests-devel/sf.Rcheck/sf/shape/nc.shp' using driver `ESRI Shapefile'
---
> Reading layer `nc' from data source `/home/edzer/git/sf.Rcheck/sf/shape/nc.shp' using driver `ESRI Shapefile'
32a33
> vdv 
33a35
> .nc 
35c37
< Dataset /data/gannet/ripley/R/packages/tests-devel/sf.Rcheck/tests/testthat/x.gpkg already exists: remove first, use update=TRUE to append,
---
> Dataset /home/edzer/git/sf.Rcheck/tests/testthat/x.gpkg already exists: remove first, use update=TRUE to append,
41c43
< OK: 471 SKIPPED: 9 FAILED: 0
---
> OK: 557 SKIPPED: 0 FAILED: 0
  Running ‘wkb.R’
  Comparing ‘wkb.Rout’ to ‘wkb.Rout.save’ ...77a78,81
> LINESTRING (1 7,2 8,3 9,4 10,5 11,6 12)
> MULTIPOINT (1 7,2 8,3 9,4 10,5 11,6 12)
> POINT (0 0)
> [1] "POINTM(0 0 0)"
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
  
  > nc = st_read(system.file("shape/nc.shp", package="sf"), quiet = TRUE)
  > 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"         "data.frame"
  > nc %>% select(SID74, SID79, geometry) %>% class()
  [1] "sf"         "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"         "data.frame"
  > nc %>% transmute(AREA = AREA/10) %>% class()
  [1] "sf"         "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
  bbox:           xmin: -84.32385 ymin: 33.88199 xmax: -75.45698 ymax: 36.58965
  epsg (SRID):    4267
  proj4string:    +proj=longlat +datum=NAD27 +no_defs
  # A tibble: 4 x 3
        area_cl `mean(AREA)`          geometry
         <fctr>        <dbl>  <simple_feature>
  1     (0,0.1]   0.07602857 <MULTIPOLYGON...>
  2  (0.1,0.12]   0.11206667 <MULTIPOLYGON...>
  3 (0.12,0.15]   0.13422727 <MULTIPOLYGON...>
  4 (0.15,0.25]   0.19039286 <MULTIPOLYGON...>
  > 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()
       VAR                 SID                  geometry  
   Length:200         Min.   : 0.000   MULTIPOLYGON :200  
   Class :character   1st Qu.: 2.000   epsg:4267    :  0  
   Mode  :character   Median : 5.000   +proj=long...:  0  
                      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
  bbox:           xmin: -79.0745 ymin: 33.88199 xmax: -76.2877 ymax: 35.01666
  epsg (SRID):    4267
  proj4string:    +proj=longlat +datum=NAD27 +no_defs
      row   VAR SID                       geometry
  195  95 SID79   4 MULTIPOLYGON(((-77.14895629...
  196  96 SID79   5 MULTIPOLYGON(((-78.26149749...
  197  97 SID79   3 MULTIPOLYGON(((-78.02592468...
  198  98 SID79  17 MULTIPOLYGON(((-78.65571594...
  199  99 SID79   9 MULTIPOLYGON(((-77.96073150...
  200 100 SID79   6 MULTIPOLYGON(((-78.65571594...
  > nc.g %>% spread(VAR, SID) %>% head()
  Simple feature collection with 6 features and 3 fields
  geometry type:  MULTIPOLYGON
  dimension:      XY
  bbox:           xmin: -81.74107 ymin: 36.07282 xmax: -75.77316 ymax: 36.58965
  epsg (SRID):    4267
  proj4string:    +proj=longlat +datum=NAD27 +no_defs
    row SID74 SID79                       geometry
  1   1     1     0 MULTIPOLYGON(((-81.47275543...
  2   2     0     3 MULTIPOLYGON(((-81.23989105...
  3   3     5     6 MULTIPOLYGON(((-80.45634460...
  4   4     1     2 MULTIPOLYGON(((-76.00897216...
  5   5     9     3 MULTIPOLYGON(((-77.21766662...
  6   6     7     5 MULTIPOLYGON(((-76.74506378...
  > 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
  bbox:           xmin: -81.74107 ymin: 36.07282 xmax: -75.77316 ymax: 36.58965
  epsg (SRID):    4267
  proj4string:    +proj=longlat +datum=NAD27 +no_defs
    row SID74 SID79                       geometry
  1   1     1     0 MULTIPOLYGON(((-81.47275543...
  2   2     0     3 MULTIPOLYGON(((-81.23989105...
  3   3     5     6 MULTIPOLYGON(((-80.45634460...
  4   4     1     2 MULTIPOLYGON(((-76.00897216...
  5   5     9     3 MULTIPOLYGON(((-77.21766662...
  6   6     7     5 MULTIPOLYGON(((-76.74506378...
  > 
  > # 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
  bbox:           xmin: 0 ymin: -7.081155e-10 xmax: 111319.5 ymax: 111325.1
  epsg (SRID):    3857
  proj4string:    +proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext  +no_defs
  POINT(0 -7.08115455161362e-10)
  POINT(111319.490793272 111325.142866385)
  > 
  > library(units)
  > person = make_unit("person")
  > nc = st_read(system.file("shape/nc.shp", package = "sf"), quiet = TRUE)
  > nc.merc <- st_transform(nc, 32119) # NC State Plane
  > 
  > 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
  bbox:           xmin: 123829 ymin: 14744.69 xmax: 930521.8 ymax: 318259.9
  epsg (SRID):    32119
  proj4string:    +proj=lcc +lat_1=36.16666666666666 +lat_2=34.33333333333334 +lat_0=33.75 +lon_0=-79 +x_0=609601.22 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs
                 mean(dens)                       geometry
  1 2.593234e-06 person/m^2 MULTIPOLYGON(((834893.70840...
  > out %>% summarise(mean(new_dens))
  Simple feature collection with 1 feature and 1 field
  geometry type:  MULTIPOLYGON
  dimension:      XY
  bbox:           xmin: 123829 ymin: 14744.69 xmax: 930521.8 ymax: 318259.9
  epsg (SRID):    32119
  proj4string:    +proj=lcc +lat_1=36.16666666666666 +lat_2=34.33333333333334 +lat_0=33.75 +lon_0=-79 +x_0=609601.22 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs
  # A tibble: 1 x 2
           `mean(new_dens)`          geometry
                    <units>  <simple_feature>
  1 2.589362e-06 person/m^2 <MULTIPOLYGON...>
  > 
  > # total densities don't:
  > nc.merc %>% summarise(sum(area * dens))
  Simple feature collection with 1 feature and 1 field
  geometry type:  MULTIPOLYGON
  dimension:      XY
  bbox:           xmin: 123829 ymin: 14744.69 xmax: 930521.8 ymax: 318259.9
  epsg (SRID):    32119
  proj4string:    +proj=lcc +lat_1=36.16666666666666 +lat_2=34.33333333333334 +lat_0=33.75 +lon_0=-79 +x_0=609601.22 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs
    sum(area * dens)                       geometry
  1    329962 person MULTIPOLYGON(((834893.70840...
  > out %>% summarise(sum(A * new_dens))
  Simple feature collection with 1 feature and 1 field
  geometry type:  MULTIPOLYGON
  dimension:      XY
  bbox:           xmin: 123829 ymin: 14744.69 xmax: 930521.8 ymax: 318259.9
  epsg (SRID):    32119
  proj4string:    +proj=lcc +lat_1=36.16666666666666 +lat_2=34.33333333333334 +lat_0=33.75 +lon_0=-79 +x_0=609601.22 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs
  # A tibble: 1 x 2
    `sum(A * new_dens)`          geometry
                <units>  <simple_feature>
  1       329962 person <MULTIPOLYGON...>
  > 
  > conn = system.file("gpkg/nc.gpkg", package = "sf")
  > db = src_sqlite(conn)
  > tbl(db, "nc.gpkg") %>% filter(AREA > 0.2) %>% collect %>% st_sf
  Error in st_sf(.) : no simple features geometry column present
  Calls: %>% ... _fseq -> freduce -> withVisible -> <Anonymous> -> st_sf
  Execution halted
Running the tests in ‘tests/read.R’ failed.
Complete output:
  > Sys.setenv(TZ="UTC")
  > suppressPackageStartupMessages(library(sf))
  > if ("GPKG" %in% st_drivers()$name) {
  + 	tst = st_read(system.file("gpkg/nc.gpkg", package="sf"), "nc.gpkg", crs = 4267, quiet = TRUE)
  + 	tst = st_read(system.file("gpkg/nc.gpkg", package="sf"), quiet = TRUE) # default layer name
  + }
  > 
  > tst = st_read(system.file("shape/nc.shp", package="sf"), quiet = TRUE) # no layer specified
  > 
  > # data from https://github.com/edzer/sfr/issues/6
  > tst = st_read(system.file("shape/storms_xyz.shp", package="sf"), quiet = TRUE)
  > class(st_geometry(tst))
  [1] "sfc_LINESTRING" "sfc"           
  > class(st_geometry(tst)[[1]])
  [1] "XYZ"        "LINESTRING" "sfg"       
  > tst = st_read(system.file("shape/storms_xyzm.shp", package="sf"), quiet = TRUE)
  > class(st_geometry(tst))
  [1] "sfc_LINESTRING" "sfc"           
  > class(st_geometry(tst)[[1]])
  [1] "XYZ"        "LINESTRING" "sfg"       
  > tst = st_read(system.file("shape/storms_xyz_feature.shp", package="sf"), quiet = TRUE)
  > class(st_geometry(tst))
  [1] "sfc_LINESTRING" "sfc"           
  > class(st_geometry(tst)[[1]])
  [1] "XYZ"        "LINESTRING" "sfg"       
  > tst = st_read(system.file("shape/storms_xyzm_feature.shp", package="sf"), quiet = TRUE)
  > class(st_geometry(tst))
  [1] "sfc_LINESTRING" "sfc"           
  > class(st_geometry(tst)[[1]])
  [1] "XYZ"        "LINESTRING" "sfg"       
  > 
  > if ("GPKG" %in% st_drivers()$name) { # read Int64
  +     print(st_read(system.file("gpkg/tl.gpkg", package="sf"), quiet = TRUE)$AWATER)
  +     print(st_read(system.file("gpkg/tl.gpkg", package="sf"), , quiet = TRUE, int64_as_string = TRUE)$AWATER)
  + }
  [1] 1028678842
  [1] 1028678842
  Levels: 1028678842
  > 
  > # see https://github.com/edzer/sfr/issues/45 :
  > if ("OSM" %in% st_drivers()$name && Sys.info()['sysname'] != "Darwin") {
  + 	osm = system.file("osm/overpass.osm", package="sf")
  + 	print(st_layers(osm))
  + 	suppressWarnings(print(st_layers(osm, do_count = TRUE)))
  + 	suppressWarnings(print(st_read(osm, "multipolygons", quiet = TRUE)))
  + }
  Driver: OSM 
  Available layers:
          layer_name       geometry_type features fields
  1           points               Point       NA     10
  2            lines         Line String       NA      9
  3 multilinestrings   Multi Line String       NA      4
  4    multipolygons       Multi Polygon       NA     25
  5  other_relations Geometry Collection       NA      4
  Driver: OSM 
  Available layers:
          layer_name       geometry_type features fields
  1           points               Point        0     10
  2            lines         Line String        0      9
  3 multilinestrings   Multi Line String        0      4
  4    multipolygons       Multi Polygon        3     25
  5  other_relations Geometry Collection        0      4
  Simple feature collection with 3 features and 25 fields
  geometry type:  MULTIPOLYGON
  dimension:      XY
  bbox:           xmin: -1.556254 ymin: 53.79519 xmax: -1.550716 ymax: 53.80341
  epsg (SRID):    4326
  proj4string:    +proj=longlat +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +no_defs
    osm_id osm_way_id name type aeroway amenity admin_level barrier boundary
  1   <NA>  263958111 <NA> <NA>    <NA>    <NA>        <NA>    <NA>     <NA>
  2   <NA>  301461256 <NA> <NA>    <NA>    <NA>        <NA>    <NA>     <NA>
  3   <NA>  462227487 <NA> <NA>    <NA>    <NA>        <NA>    <NA>     <NA>
    building craft geological historic land_area landuse leisure man_made
  1     <NA>  <NA>       <NA>     <NA>      <NA>    <NA>    park     <NA>
  2     <NA>  <NA>       <NA>     <NA>      <NA>    <NA>    park     <NA>
  3     <NA>  <NA>       <NA>     <NA>      <NA>    <NA>    park     <NA>
    military natural office place shop sport tourism other_tags
  1     <NA>    <NA>   <NA>  <NA> <NA>  <NA>    <NA>       <NA>
  2     <NA>    <NA>   <NA>  <NA> <NA>  <NA>    <NA>       <NA>
  3     <NA>    <NA>   <NA>  <NA> <NA>  <NA>    <NA>       <NA>
                          geometry
  1 MULTIPOLYGON(((-1.5507185 5...
  2 MULTIPOLYGON(((-1.5557631 5...
  3 MULTIPOLYGON(((-1.551502 53...
  > 
  > # layer opening option:
  > st_read(system.file("shape/nc.shp", package="sf"),  quiet = TRUE,
  + 	options = c("ADJUST_TYPE=YES", "ENCODING=CPL_ENC_UTF8"))
  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
  epsg (SRID):    4267
  proj4string:    +proj=longlat +datum=NAD27 +no_defs
  First 20 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
  11 0.114     1.352  1838    1838     Caswell 37033  37033       17  1035     2
  12 0.153     1.616  1839    1839  Rockingham 37157  37157       79  4449    16
  13 0.143     1.663  1840    1840   Granville 37077  37077       39  1671     4
  14 0.109     1.325  1841    1841      Person 37145  37145       73  1556     4
  15 0.072     1.085  1842    1842       Vance 37181  37181       91  2180     4
  16 0.190     2.204  1846    1846     Halifax 37083  37083       42  3608    18
  17 0.053     1.171  1848    1848  Pasquotank 37139  37139       70  1638     3
  18 0.199     1.984  1874    1874      Wilkes 37193  37193       97  3146     4
  19 0.081     1.288  1880    1880     Watauga 37189  37189       95  1323     1
  20 0.063     1.000  1881    1881  Perquimans 37143  37143       72   484     1
     NWBIR74 BIR79 SID79 NWBIR79                       geometry
  1       10  1364     0      19 MULTIPOLYGON(((-81.47275543...
  2       10   542     3      12 MULTIPOLYGON(((-81.23989105...
  3      208  3616     6     260 MULTIPOLYGON(((-80.45634460...
  4      123   830     2     145 MULTIPOLYGON(((-76.00897216...
  5     1066  1606     3    1197 MULTIPOLYGON(((-77.21766662...
  6      954  1838     5    1237 MULTIPOLYGON(((-76.74506378...
  7      115   350     2     139 MULTIPOLYGON(((-76.00897216...
  8      254   594     2     371 MULTIPOLYGON(((-76.56250762...
  9      748  1190     2     844 MULTIPOLYGON(((-78.30876159...
  10     160  2038     5     176 MULTIPOLYGON(((-80.02567291...
  11     550  1253     2     597 MULTIPOLYGON(((-79.53050994...
  12    1243  5386     5    1369 MULTIPOLYGON(((-79.53050994...
  13     930  2074     4    1058 MULTIPOLYGON(((-78.74912261...
  14     613  1790     4     650 MULTIPOLYGON(((-78.80680084...
  15    1179  2753     6    1492 MULTIPOLYGON(((-78.49252319...
  16    2365  4463    17    2980 MULTIPOLYGON(((-77.33220672...
  17     622  2275     4     933 MULTIPOLYGON(((-76.29892730...
  18     200  3725     7     222 MULTIPOLYGON(((-81.02056884...
  19      17  1775     1      33 MULTIPOLYGON(((-81.80622100...
  20     230   676     0     310 MULTIPOLYGON(((-76.48052978...
  > 
  > x <- st_sf(a = 1:2, geom = st_sfc(st_point(0:1), st_multipoint(matrix(1:4,2,2))))
  > 
  > try(st_layers("foo")) # cannot open datasource
  Cannot open data source foo
  Error in CPL_get_layers(dsn, options, do_count) : Open failed.
  
  > try(st_read("foo")) # cannot open datasource
  Cannot open data source foo
  Error in CPL_read_ogr(dsn, layer, as.character(options), quiet, type,  : 
    Open failed.
  
  > try(st_read("x.gpkg", "xyz")) # cannot open layer
  Cannot open data source x.gpkg
  Error in CPL_read_ogr(dsn, layer, as.character(options), quiet, type,  : 
    Open failed.
  
  > try(st_write(c("foo", "bar")))
  Error in st_write(c("foo", "bar")) : inherits(obj, "sf") is not TRUE
  > try(st_write(x, c("foo", "bar")))
  Error in guess_driver(dns) : length(dsn) == 1 is not TRUE
  In addition: Warning message:
  In if (file.exists(dsn)) dsn = normalizePath(dsn) :
    the condition has length > 1 and only the first element will be used
  > try(st_write(x, "foo", driver = "foo"))
  driver `foo' not available.
  Error in CPL_write_ogr(obj, dsn, layer, driver, as.character(dataset_options),  : 
    Driver not available.
  
  > if (Sys.getenv("USER") == "travis") {
  + 	try(st_write(x, "/x", driver = "ESRI Shapefile"))
  + }
  > 
  > df <- data.frame(
  +     a = c(0, 1, NA, -Inf, Inf),
  +     b = c("a", "b", NA, "c", ""),
  +     c = c(as.Date("2001-01-01"), NA, -99, 0, 1),
  +     d = c(as.POSIXct("2001-01-01"), NA, -99, 0, 1),
  +     x = 1:5,
  +     y = 1:5)
  > 
  > x  = st_as_sf(df, coords = c("x", "y"))
  > 
  > if ("GPKG" %in% st_drivers()$name) {
  +  st_write(x, "x2.gpkg", quiet = TRUE)
  +  y = st_read("x2.gpkg", quiet = TRUE)
  +  print(y)
  + }
  Simple feature collection with 5 features and 4 fields
  geometry type:  POINT
  dimension:      XY
  bbox:           xmin: 1 ymin: 1 xmax: 5 ymax: 5
  epsg (SRID):    NA
  proj4string:    NA
       a    b          c                   d       geom
  1    0    a 2001-01-01 2001-01-01 00:00:00 POINT(1 1)
  2    1    b       <NA>                <NA> POINT(2 2)
  3   NA <NA> 1969-09-24 1969-12-31 23:58:21 POINT(3 3)
  4 -Inf    c 1970-01-01 1970-01-01 00:00:00 POINT(4 4)
  5  Inf      1970-01-02 1970-01-01 00:00:01 POINT(5 5)
  > 
  > if ("SQLite" %in% st_drivers()$name && require(RSQLite)) {
  + 	db = system.file("sqlite/meuse.sqlite", package = "sf")
  + 	dbcon <- dbConnect(dbDriver("SQLite"), db)
  + 	m = dbReadTable(dbcon, "meuse.sqlite")
  + 	m$GEOMETRY = st_as_sfc(m$GEOMETRY, spatialite = FALSE) # ISO wkb
  + 	print(st_sf(m), n = 3)
  + 
  + 	db = system.file("sqlite/nc.sqlite", package = "sf")
  + 	dbcon <- dbConnect(dbDriver("SQLite"), db)
  + 	m = dbReadTable(dbcon, "nc.sqlite")
  + 	m$GEOMETRY = st_as_sfc(m$GEOMETRY, spatialite = FALSE) # ISO wkb
  + 	print(st_sf(m), n = 3)
  + 
  + 	db = system.file("sqlite/b.sqlite", package = "sf") # has an INT8 field
  + 	b = st_read(db)
  + 	print(b)
  + 	b = st_read(db, int64_as_string=TRUE)
  + 	print(b)
  + 
  + 	if (.Platform$endian == "little") {
  + 	  db = system.file("sqlite/test3.sqlite", package = "sf")
  + 	  dbcon <- dbConnect(dbDriver("SQLite"), db)
  + 	  m = dbReadTable(dbcon, "HighWays")
  + 	  m$Geometry = st_as_sfc(m$Geometry, spatialite = TRUE) # spatialite wkb
  + 	  print(st_sf(m), n = 3)
  + 	  m = dbReadTable(dbcon, "Towns")
  + 	  m$Geometry = st_as_sfc(m$Geometry, spatialite = TRUE) # spatialite wkb
  + 	  print(st_sf(m), n = 3)
  + 	  m = dbReadTable(dbcon, "Regions")
  + 	  m$Geometry = st_as_sfc(m$Geometry, spatialite = TRUE) # spatialite wkb
  + 	  print(st_sf(m), n = 3)
  + 	}
  + }
  Loading required package: RSQLite
  Error in UseMethod("st_as_sfc") : 
    no applicable method for 'st_as_sfc' applied to an object of class "blob"
  Calls: st_as_sfc
  Execution halted