Skip to contents

Example data sets

Small collections of, for example, shapefiles that are useful for testing or demonstrating the features of the package.

NASHVILLE_NH
Two 2020 Census tracts from the northern part of Nashua, NH.
UNIT_PENTAGON
An sfc object that is a five-sided polygon with area 1.

Metadata

Descriptions of the layout of data from TIGER/Line or other sources, as well as various defaults, like colors for maps of terrain.

DECENNIAL_POPULATION_VARIABLE_FORMATS
Formats for decennial census variables of overall population.
DECENNIAL_TABULATION_CROSSWALK
The layout for a crosswalk of tabulation blocks between decennial censuses
TERRAIN_COLORS
A named character vector of hex-encoded colors for water, developed and undeveloped land.
TIGER_ATTRIBUTES
A named character vector of shapefile attributes for data from TIGER/Line

Terrain

Categorize or display terrain, e.g. urban vs. rural, land vs. water

geom_terrain()
Plot census blocks by water or land use
is_water()
Identify geographies that are all water
terrain_factor()
Create a factor of terrains based on census reporting of water area and land use.

TIGER/Line functions

Read shapefiles that have been downloaded from the US Census Bureau’s TIGER/Line shapefile database.

fix_latlong_to_numeric()
Convert interpreted latitude and longitude from text to numbers
fix_names_by_coalescing()
Coalesce NAME and NAMELSAD fields to fix blank NAME entries
fix_old_geoids()
Replace ID fields with "GEOID"
fix_old_year_suffixes()
Remove year numbers from the end of field names
geoid_to_tract_id()
Extract the 4- or 6-digit tract codes from full census GEOID values
batch_read_tigershapes()
Load geographies from many shapefiles into a tibble of simple features
read_tigershapes()
Import data from US Census TIGER/Line shapefiles
transform_tiger_to_utm()
Transform native TIGER/Line lat-long features to UTM features
tiger_name_for()
Create a tigershape filename based upon state, year, and geography

Decennial census functions

A major use-case for this package is to map American Community Survey data from tracts to more concrete, real-world geographical places. One way to do this is to use block populations from each decennial census.

decennial_pl_variable()
Variable names for PL tables, per the idiosyncrasies of decennial censuses
truncate_decennial_tract_codes()
Lop off trailing "00"s from census tract codes from 2000.
crosswalk_spec()
Compute the names of the columns in a tabulation crosswalk table
read_crosswalk()
Read a file with crosswalk information between the blocks of two consecutive decennial censuses.

Geometric operations

Specialized functions that generally build upon more modularly-designed functions from the simple features package.

geometry_filter()
Filter one or more geometries by a reference geometry using a single geometric predicate.
central_utm()
Find the median UTM Zone from a vector of longitudes.
utm_crs()
Create a coordinate reference system for a UTM Zone and datum.
utm_zone_from_longitude()
Identify the UTM Zone that corresponds to a longitude