Source access · 2000–2024
From a question to records in R
natality connects annual birth records to their original definitions. Search variables, inspect changes, then read the columns you need. Source codes stay intact; combining years requires a separate scientific decision.
Install the public alpha
Version 0.7.1 is available from GitHub. The package is not on CRAN. Install R and the dependencies first, then run the code below in RStudio or an R console.
install.packages(c("digest", "jsonlite", "arrow"))
install.packages(
"https://github.com/atalaydemiray/natality-data/releases/download/natality-r-0.7.1-alpha/natality_0.7.1.tar.gz",
repos = NULL, type = "source"
)
library(natality)A first read
This example reads U.S.-resident births in 2024. read_natality() defaults to all occurrence records unless you specify the population.
library(natality)
# Explore definitions before downloading records
natality_years(details = TRUE)
natality_vars("birth weight", years = 2024)
natality_codebook("DBWT", years = 2024)
# One birth per row; original source codes are retained
births <- read_natality(
2024, vars = c("MAGER", "DBWT", "OEGest_Comb"),
population = "us_residents"
)
head(births)
attr(births, "natality_provenance")Expect one row per birth, the requested native fields, and a year column. Public release fields are character strings so blanks, leading zeros and special codes survive import. A recorded birth is not a unique mother.
Choose years deliberately
Public record-level downloads cover 2000–2024. The source catalogue also lists unprocessed releases; catalogue presence does not mean a file is ready to read. The 2025 final archive is retained, but an authoritative annual layout is still needed before parsing and release.
natality_changes("DPLURAL", years = 2014:2024)
natality_codebook("ESTGEST", years = 2007:2013)
natality_concepts("gestational_diabetes")
natality_sources()Multi-year reads require the field in every requested year and refuse incompatible names, types or labels. A common name alone does not establish comparable measurement. Review the annual codes, reporting population and certificate era in the variable dictionary.
Downloads, storage and offline use
The first read downloads the complete annual Parquet file from a pinned GitHub release. Selecting fewer columns reduces the data read into R, but not that initial download. Later reads verify and reuse the cache.
natality_cache_dir()
natality_cache_info()
# After downloading 2024, require an offline read
births <- read_natality(2024, vars = "DOB_MM", download = FALSE)Parquet is an open column-based format also readable in Python and other tools. The annual files are distributed separately from the small R package. An outage of CDC does not remove a verified cached file or our existing GitHub data release.
Cite data and software
natality_cite(2024)
natality_cite(2020:2024, format = "bibtex")
citation("natality")Report the years, population, variables, exclusions and package version in your methods. Cite NCHS as the data producer and Natality Atlas as the access software.