|
1 | 1 | test_that("we can read a shapefile using st_read", { |
2 | | - nc <- st_read(system.file("shape/nc.shp", package="sf"), "nc", crs = 4267, quiet = TRUE) |
3 | | - expect_identical(class(nc), c("sf", "data.frame")) |
| 2 | + nc <- st_read(system.file("shape/nc.shp", package = "sf"), "nc", crs = 4267, quiet = TRUE) |
| 3 | + expect_s3_class(nc, c("sf", "data.frame"), exact = TRUE) |
4 | 4 | expect_equal(dim(nc), c(100, 15)) |
5 | 5 | }) |
6 | 6 |
|
7 | 7 | test_that("we can read shapefiles with a query string", { |
8 | 8 | nc <- st_read(system.file("shape/nc.shp", package="sf"), "nc", crs = 4267, quiet = TRUE) |
9 | | - nc_all <- st_read(system.file("shape/nc.shp", package="sf"), "nc", query = "select * from nc", crs = 4267, quiet = TRUE) |
10 | | - nc_some <- st_read(system.file("shape/nc.shp", package="sf"), "nc", query = "select * from nc where SID79 > 50", crs = 4267, quiet = TRUE) |
| 9 | + nc_all <- st_read(system.file("shape/nc.shp", package="sf"), query = "select * from nc", crs = 4267, quiet = TRUE) |
| 10 | + nc_some <- st_read(system.file("shape/nc.shp", package="sf"), query = "select * from nc where SID79 > 50", crs = 4267, quiet = TRUE) |
11 | 11 | }) |
12 | 12 |
|
13 | 13 | test_that("st_read.default gives error messages", { |
|
0 commit comments