Skip to contents

Read shapefile from a folder

Usage

shapefile_from_folder(folder = NULL, cleanit = TRUE, crs = 4269, ...)

Arguments

folder

path of folder that contains the files (.shp, .shx, .dbf, and .prj)

cleanit

set to FALSE if you want to skip validation and dropping invalid rows

crs

passed to shapefile_from_filepaths() default is crs = 4269 or Geodetic CRS NAD83

...

passed to sf::st_read()

Value

a shapefile object using sf::st_read()

See also

shapefile_from_folder()

Examples

if (FALSE) { # \dontrun{
  testfolder <- system.file("testdata/shapes/Portland_neighborhoods", package = "EJAM")
  testshape <- shapefile_from_folder(testfolder)

  testpaths <- shapefile_filepaths_from_folder(testfolder)
  testshape <- shapefile_from_filepaths(testpaths)

  ## if interactive(), R user can point to right folder or select the right set of files:
  # testshape <- shapefile_from_filepaths()
  # testshape <- shapefile_from_folder()

  x <- get_blockpoints_in_shape(testshape)
  leaflet(x$polys) %>% addTiles() %>% addPolygons(color = "blue")
  DT::datatable(out$results_bysite)

  } # }