Read IPUMS geometry using ipumsr::read_ipums_sf
Usage
read_ipums_geometry(
shape_file = NULL,
path = NULL,
file_select = NULL,
vars = "GISJOIN",
encoding = NULL,
bind_multiple = TRUE,
add_layer_var = NULL,
verbose = FALSE
)Arguments
- shape_file
Path to a single .shp file or a .zip archive containing at least one .shp file. See Details section.
- path
Named list or vector with the name "shape". Optional if
shape_fileis supplied.- file_select
If
shape_fileis a .zip archive that contains multiple files, an expression identifying the files to load. Accepts a character string specifying the file name, a tidyselect selection, or index position. If multiple files are selected,bind_multiplemust be equal toTRUE.- vars
Names of variables to include in the output. Accepts a character vector of names or a tidyselect selection. If
NULL, includes all variables in the file.- encoding
Encoding to use when reading the shape file. If
NULL, defaults to"latin1"unless the file includes a .cpg metadata file with encoding information. The default value should generally be appropriate.- bind_multiple
If
TRUEandshape_filecontains multiple .shp files, row-bind the files into a singlesfobject. Useful whenshape_filecontains multiple files that represent the same geographic units for different extents (e.g. block-level data for multiple states).- add_layer_var
If
TRUE, add a variable to the output data indicating the file that each row originates from. Defaults toFALSEunlessbind_multiple = TRUEand multiple files exist inshape_file.The column name will always be prefixed with
"layer", but will be adjusted to avoid name conflicts if another column named"layer"already exists in the data.- verbose
If
TRUEreport additional progress information on load.