Skip to main content

Glossary

Key terms used in this book. In the chapters, a term with a dotted underline shows its definition when you hover over it, tap it, or reach it with the Tab key.

1-year estimates
ACS estimates from 12 months of responses. They are the most current but are only published for areas of 65,000 people or more.
5-year estimates
ACS estimates that pool 60 months of responses. They are the most reliable ACS product and the only one for tracts and block groups. An estimate labeled 2022 describes 2018 to 2022.
American Community Survey (ACS)
The Census Bureau’s continuous survey of a sample of households every year. It asks many more questions than the decennial census, but every value is an estimate with a margin of error.
ANOVA
Analysis of variance: a statistical test of whether the averages of several groups are different, such as average incomes in two cities.
API
Application Programming Interface: a set of rules for how one program asks another for data or services, such as your R script asking the Census Bureau’s server for a table.
API key
A private code that identifies you to an API. Store it in .Renviron, never in a script you share.
apportionment
Dividing the seats in the House of Representatives among the states by population, the reason the Constitution requires a census.
argument
An input to a function, written inside its parentheses.
ascending order
Smallest to largest for numbers, A to Z for text. arrange() sorts in ascending order unless you wrap the column in desc().
assignment operator
<-, the arrow that stores the value on its right in the name on its left. Read x <- 5 as “x gets 5.”
block group
A group of census blocks, usually holding 600 to 3,000 people. It is the smallest geography with ACS 5-year estimates.
block of code
Several lines of code that work together on one task, like the steps of one recipe. In R Markdown, a block usually lives in one code chunk.
Boolean
Another name for logical (TRUE or FALSE) values, after the mathematician George Boole.
camelCase
A way of naming variables that joins words and capitalizes every word after the first, as in popChapelHill.
case-sensitive
Treating capital and lowercase letters as different. In R, Months and months are two different names.
census block
The smallest Census geography, often a single city block bounded by streets or other visible features. Only decennial census data are published for blocks.
census tract
A small area of about 1,200 to 8,000 people (4,000 on average), drawn to be fairly stable over time. The workhorse unit for neighborhood analysis.
character
The data type for text, also called strings. Character values always go inside quotation marks, as in "Chapel Hill".
cheatsheet
A one-page summary of a package or tool. Posit publishes them for dplyr, ggplot2, RStudio, and more.
clustering
Methods that find groups of similar observations, or groups of places with similar values that sit close together.
code chunk
A block of R code inside an R Markdown file, starting with ```{r} and ending with three backticks.
coefficient of variation (CV)
The standard error as a percentage of the estimate. A CV above about 30% is a common sign that an estimate is unreliable.
coercion
R converting values from one data type to another. Mixing types in one vector coerces them all to the type that can hold everything, usually character.
colon operator
:, which makes a sequence of whole numbers: 6:8 is c(6, 7, 8).
comment
A note for people that R ignores. In R, a comment starts with #.
comparison operator
An operator that compares two values and returns TRUE or FALSE: >, <, >=, <=, == (equal to), and != (not equal to).
compiler
A program that translates a whole program into machine code before any of it runs. C and Java are compiled; R is interpreted.
confidence level
How sure you can be that the true value lies within a range. The ACS uses a 90% confidence level for its margins of error.
Console
The RStudio pane (bottom left) where R runs commands and prints results, warnings, and errors. Nothing typed here is saved.
coordinate system
The rules that tie coordinates to places on the Earth, including how the round Earth is flattened onto a map (the projection). Layers must share a coordinate system before you can combine them.
CRAN
The Comprehensive R Archive Network: the official website for downloading R and most R packages.
CSV
A plain-text table in which each line is a row and commas separate the values. Read one into R with read.csv() or read_csv().
data frame
R’s table: rows are observations and columns are variables. A tibble is the tidyverse’s version of a data frame.
data science workflow
The steps of a data analysis: import, tidy, then a loop of transform, visualize, and model, and finally communicate.
data type
The kind of value R is storing. The four main atomic types are logical, integer, numeric, and character; class() tells you which you have.
debugging
Finding and fixing the mistakes (bugs) in code: read the error message, find the line, make a guess, and test it.
decennial census
The full count of everyone in the US, every ten years. It asks only a few questions but covers every person.
delimiter
The character that separates values in a text file of data, such as a comma in a CSV file or a tab.
Demographic and Housing Characteristics (DHC)
The 2020 census product with more detailed tables on age, sex, households, and housing than the redistricting data.
denominator
The number you divide by to turn a count into a share, usually the total of the same table, such as total population.
descending order
Largest to smallest for numbers, Z to A for text. Ask arrange() for it with desc(), as in arrange(desc(dep_delay)).
differential privacy
Carefully calibrated random noise added to published 2020 census tables to protect respondents’ privacy. It matters most for small areas such as blocks.
dplyr
The tidyverse package for transforming data frames: filtering rows, choosing columns, adding new columns, joining tables, and summarizing.
Editor
The RStudio pane (top left) where you write and save scripts and R Markdown files. Code here can be kept and run again.
endpoint
The web address of one dataset or service in an API, such as https://api.census.gov/data/2022/acs/acs5.
Environment
The RStudio pane (top right) that lists the variables and data currently in memory.
file path
The location of a file on your computer, such as data/counties.csv. When you knit, paths are read relative to the folder the .Rmd file is saved in.
FIPS code
A standard numeric code for a state or county (Federal Information Processing Standards). North Carolina is 37.
first law of geography
Waldo Tobler’s statement that “everything is related to everything else, but near things are more related than distant things.” It is the idea behind spatial autocorrelation.
function
Code that takes inputs (arguments), does a job, and returns an output, such as mean(temps).
geocoding
Turning an address or place name into coordinates that can be mapped.
GEOID
The unique ID of a Census area, made by stringing together the FIPS codes of each level, such as 37135 for Orange County, NC. Keep GEOIDs as text, and join tables on them.
ggplot2
The tidyverse package for making plots and maps by adding layers.
grouped data frame
A data frame made by group_by(). It looks the same, but later verbs work on each group separately until you call ungroup().
header
The first line of a data file, when it holds the column names.
help page
A function’s documentation, opened with ?name or help(name). Every help page has a Description, Usage, Arguments, and Examples.
hotspot
A cluster of places with unusually high values, such as a group of neighborhoods with many burglaries. Finding hotspots is a common goal of spatial analysis.
HTTP
The protocol web browsers and servers use to talk. A GET request reads data; a POST request sends data.
httr2
An R package for building, sending, and reading web (HTTP) requests, used to call an API by hand.
independence
The assumption, built into most standard statistics, that knowing one observation tells you nothing about another. Data about places usually break it, because nearby places tend to be alike.
indexing
Selecting part of a vector or data frame with square brackets: by position (vect[3]), by a condition (vect[vect > 10]), or by name (vect["Fozzie"]).
integer
The data type for whole numbers. R stores a typed number as numeric unless you add an L, as in 21L. Shown as <int> by glimpse().
integrated development environment (IDE)
A program that puts everything for writing code in one window: an editor, a place to run the code, and tools to inspect the results.
interpreted language
A language, like R, that runs code one line at a time: an interpreter reads each line, translates it, and runs it before moving on.
Jenks natural breaks
A way of dividing values into map classes that puts the breaks where the gaps between values are largest, so similar values share a color.
join
Combining two tables by matching rows on a shared key column, such as attaching Census data to boundaries by GEOID with left_join().
JSON
JavaScript Object Notation: structured text that most web APIs send back, which R can turn into lists or data frames.
knit
To build an R Markdown file into a finished document (HTML, PDF, or Word). Knitting reruns every code chunk from the top in a fresh R session.
library
The folder on your computer where installed packages are stored. You install packages into a library, then load them with library().
logical
The data type for TRUE and FALSE values, written in capitals with no quotation marks.
logical operator
An operator that combines TRUE and FALSE values: & (AND, both must be true), | (OR, either can be true), and ! (NOT).
logical vector
A vector of TRUE and FALSE values, such as the result of vect > 10. Inside square brackets it keeps the TRUE positions.
margin of error (MOE)
How far a sample estimate might be from the true value. ACS margins of error use a 90% confidence level: there is a 90% chance the true value lies within the estimate plus or minus the MOE.
Markdown
A simple way of formatting plain text: # for headings, *italic*, **bold**, and - for list items.
masking
When two loaded packages have a function with the same name, the one loaded later hides (masks) the other. Reach the hidden one with package::function().
mean
The average: the sum of the values divided by how many there are. A few very large or small values can pull it a long way.
mean center of population
The point where a flat map of the country would balance if every resident weighed the same.
median
The middle value when values are sorted, so half are above and half below. Unlike counts, medians can’t be added across areas.
metadata
Data about data: who made a dataset, when, how, and what each part means. In a YAML header, it describes the document.
microdata
Records for individual people or households (with identifying details removed), rather than totals for areas. The ACS publishes microdata as PUMS.
missing value
A value that is unknown, written NA (“not available”) in R. Most calculations with NA give NA; test for it with is.na().
modifiable areal unit problem (MAUP)
The way results can change when the same individual data are grouped into different areas, either larger or smaller ones or the same size with different boundaries.
named argument
An argument given with its name, such as digits = 1 in round(x, digits = 1).
negative index
An index with a minus sign, such as vect[-3], which drops that position and returns the rest.
nesting
When every smaller area lies entirely inside exactly one larger area, as blocks do inside block groups, tracts, and counties. Nested areas can be added up without double-counting anyone.
network analysis
Analysis of movement along a network, such as roads, to measure travel distance or time, or how easily people can reach a place.
nominal dollars
Dollar amounts as reported in their own year, not adjusted for inflation. Adjust them before comparing across years.
numeric
The data type for numbers that can have a decimal part, such as 103.21. Also called double, and shown as <dbl> by glimpse().
nycflights13
An R package of data on every flight that left New York City’s three airports in 2013, including the flights data frame.
observation
One thing that was measured or recorded, such as a student, a county, or a flight. In a data frame, each row is an observation.
outlier
A value far from all the others. It may be real or an error, so check it before you report it.
package
A bundle of code, written by other users, that adds new functions to R. Install it once with install.packages(), then load it in each session with library().
parameter
A name=value setting added to an API request after the ?, such as for=county:*, that says what you want.
percentile
The value below which a given share of the values fall: a quarter of values are below the 25th percentile. quantile() in R.
pipe
The operator |>, which passes the result on its left as the first argument of the function on its right. Read it as “and then.”
polygon
A closed shape that represents an area, such as a county, a lake, or a census tract.
program
A set of lines and blocks of code that work together to do a whole job. R runs a program from top to bottom, so order matters.
purrr
The tidyverse package for repeating a task over many inputs, such as downloading data for several years.
Quarto
The newer successor to R Markdown, from the same developers. Quarto files end in .qmd. This book is written in Quarto.
R Markdown
A document format (.Rmd) that mixes formatted text with chunks of R code. Knitting it runs the code and builds a finished report.
R script
A plain file of R code, ending in .R. Anything that isn’t code must be written as a comment.
R session
One run of R, from start to finish. A new session starts with an empty Environment and no packages loaded; knitting always starts a fresh one.
raster
Spatial data stored as a grid of cells (pixels), each holding a value, such as a satellite image or an elevation model. In R, the terra package handles rasters.
recycling
R repeating a shorter vector until it matches the length of a longer one, so vect[c(TRUE, FALSE)] keeps every other element.
redistricting data (PL 94-171)
The first 2020 census product: basic population, race, voting-age, and housing counts down to the block, used to redraw voting districts.
regression
A statistical model of how one variable (such as home price) changes with one or more others (such as distance to downtown).
reproducibility
The ability for anyone to rerun an analysis from its code and data and get the same result.
REST
The most common style of web API: each dataset has its own URL, you ask for data with ordinary web requests, and the answer usually comes back as JSON.
RStudio
The integrated development environment (IDE) where you write and run R. R does the computing; RStudio is the workspace around it.
sample
A subset of a population that is surveyed to estimate something about the whole population. Smaller samples give less certain estimates.
scale
The level of detail at which you study something: addresses, neighborhoods, counties, or states. A pattern that is clear at one scale can vanish or reverse at another.
selection helper
A function that picks columns by name inside select(), such as starts_with(), ends_with(), and contains().
sf
“Simple features”: the R package for spatial vector data. An sf object is a data frame with a geometry column holding each row’s point, line, or polygon.
skewed
Lopsided: most values are bunched at one end, with a long tail of unusual values at the other, which pulls the mean away from the median.
snake_case
A way of naming variables with lowercase words joined by underscores, as in pop_chapel_hill. The tidyverse style guide uses it.
spatial autocorrelation
The tendency for things that are close together to be more alike than things that are far apart, such as neighboring counties having similar incomes.
spatial data science
The use of data that have a location attached to answer questions about the world. It combines what we study (the spatial), how we handle it (data skills), and how we ask and answer questions (science).
spatial heterogeneity
The idea that relationships between variables change from place to place. A link that is strong in one city may be weak, or reversed, in another.
spatial thinking
Taking seriously how location connects observations: asking whether nearby values are alike, whether a pattern depends on the size of the areas, and whether a relationship holds everywhere.
standard deviation
A measure of how spread out values are around their mean, in the same units as the values. sd() in R.
standard error
A measure of how much a sample estimate would vary from sample to sample. For the ACS, it is the margin of error divided by 1.645.
summary statistic
One number that describes many values, such as their mean, median, maximum, or count. summarize() calculates them.
syntax
The exact rules for writing code: spelling, capitalization, commas, quotation marks, and matching brackets.
terra
An R package for working with raster data.
tidy data
Data arranged so that each variable is a column, each observation is a row, and each value has its own cell.
tidycensus
An R package that downloads US Census data through the Census API and returns it as a tidy data frame, with boundaries attached if you ask.
tidyverse
A family of R packages (including dplyr, ggplot2, and readr) for reading, cleaning, reshaping, summarizing, and plotting data, all designed to work together.
tie
Two or more rows with the same value in the column being sorted. arrange() breaks ties with the next column you name.
TIGER
The Census Bureau’s national digital map database of streets and boundaries, first used for the 1990 census. Census boundary files come from it.
tigris
An R package that downloads Census boundary files (TIGER/Line shapefiles) as sf objects.
tmap
An R package for making thematic maps quickly, with sensible defaults.
truth table
A table listing the result of a logical operator for every combination of TRUE and FALSE inputs.
unique value
A value counted once, however many times it repeats. distinct() keeps one row for each unique value, or each unique combination of values.
variable
In R, a named piece of memory that holds data, such as months <- 12. In a dataset, a measured characteristic, such as median income; each Census variable has a code.
variance
A measure of spread: the standard deviation squared, so its units are squared too. var() in R.
vector
A sequence of values that R stores together, made with c(), such as c(71, 75, 68).
vector data
Spatial data stored as points, lines, and polygons, each with a table of attributes. In R, the sf package handles vector data.
vectorized
Done to every element of a vector at once, without a loop. Arithmetic in R is vectorized, so distance / air_time divides row by row.
verb
A dplyr function named for the job it does to a data frame, such as filter(), select(), arrange(), and mutate().
weighted average
An average in which some values count more than others. Total distance divided by total air time weights each flight’s speed by its air time.
wrapper package
An R package that hides the details of calling an API behind simple functions, such as tidycensus for the Census API.
YAML header
The block at the top of an R Markdown file, between two lines of three dashes, that holds the document’s title, author, date, and output format.
ZIP Code Tabulation Area (ZCTA)
The Census Bureau’s approximation of a ZIP code’s area, built from census blocks. ZCTAs do not nest inside counties or tracts.