natalityr provides tools for importing, processing, and analyzing CDC Natality Public Use Files (2016-2024). Imported features and analyses are focused on birth mother characteristics and method of delivery.

This package includes functions that:

  • Import fixed-width natality files.

  • Create derived variables for cesarean status and NTSV classification.

  • View CDC code information for natality variables.

  • Calculate cesarean delivery rates and Wilson confidence intervals.

Installation

You can install natalityr from GitHub using:

devtools::install_github("nicossoares/natalityr")

Upon completion, you can run the following code in R:

library(natalityr)

Current dependencies for this library include reticulate, arrow, dplyr, and stats.

You can view the GitHub repository here: https://github.com/nicossoares/natalityr

The package website is available here: https://nicossoares.github.io/natalityr/

Notes on Future Changes to the Package

In the future, this package may be updated to fulfill some of the following goals:

  • Allow for the inclusion of additional variables regarding the infant, health outcomes post-delivery, and more.

  • Allow for the user to choose whether to use the CDC’s pre-imputed entries, or to code all missing values as NA so that the user may customize missing data methods.

  • Create a derived variable for labor pathways during the data-processing function.

Session Info

This package was developed in the following environment.

─ Session info ─────────────────────────────────────────────────────
 setting  value
 version  R version 4.5.2 (2025-10-31)
 os       macOS Tahoe 26.5
 system   aarch64, darwin20
 ui       RStudio
 language (EN)
 collate  en_US.UTF-8
 ctype    en_US.UTF-8
 tz       America/Los_Angeles
 date     2026-06-08
 rstudio  2026.05.0+218 Golden Wattle (desktop)
 pandoc   3.8.3 @ /Applications/RStudio.app/Contents/Resources/app/quarto/bin/tools/aarch64/ (via rmarkdown)
 quarto   1.9.37 @ /Applications/RStudio.app/Contents/Resources/app/quarto/bin/quarto

─ Packages ─────────────────────────────────────────────────────────
 package     * version    date (UTC) lib source
 cli           3.6.6      2026-04-09 [1] CRAN (R 4.5.2)
 digest        0.6.39     2025-11-19 [1] CRAN (R 4.5.2)
 dplyr         1.2.1      2026-04-03 [1] CRAN (R 4.5.2)
 evaluate      1.0.5      2025-08-27 [1] CRAN (R 4.5.0)
 fastmap       1.2.0      2024-05-15 [1] CRAN (R 4.5.0)
 generics      0.1.4      2025-05-09 [1] CRAN (R 4.5.0)
 glue          1.8.1      2026-04-17 [1] CRAN (R 4.5.2)
 here          1.0.2      2025-09-15 [1] CRAN (R 4.5.0)
 htmltools     0.5.9      2025-12-04 [1] CRAN (R 4.5.2)
 jsonlite      2.0.0      2025-03-27 [1] CRAN (R 4.5.0)
 knitr         1.51       2025-12-20 [1] CRAN (R 4.5.2)
 lattice       0.22-7     2025-04-02 [1] CRAN (R 4.5.2)
 lifecycle     1.0.5      2026-01-08 [1] CRAN (R 4.5.2)
 magrittr      2.0.5      2026-04-04 [1] CRAN (R 4.5.2)
 Matrix        1.7-4      2025-08-28 [1] CRAN (R 4.5.2)
 natalityr     0.0.0.9000 2026-06-08 [1] Github (nicossoares/natalityr@e7db433)
 otel          0.2.0      2025-08-29 [1] CRAN (R 4.5.0)
 pillar        1.11.1     2025-09-17 [1] CRAN (R 4.5.0)
 pkgconfig     2.0.3      2019-09-22 [1] CRAN (R 4.5.0)
 png           0.1-9      2026-03-15 [1] CRAN (R 4.5.2)
 R6            2.6.1      2025-02-15 [1] CRAN (R 4.5.0)
 Rcpp          1.1.1-1.1  2026-04-24 [1] CRAN (R 4.5.2)
 reticulate    1.46.0     2026-04-09 [1] CRAN (R 4.5.2)
 rlang         1.2.0      2026-04-06 [1] CRAN (R 4.5.2)
 rmarkdown     2.30       2025-09-28 [1] CRAN (R 4.5.0)
 rprojroot     2.1.1      2025-08-26 [1] CRAN (R 4.5.0)
 rstudioapi    0.17.1     2024-10-22 [1] CRAN (R 4.5.0)
 sessioninfo   1.2.3      2025-02-05 [1] CRAN (R 4.5.0)
 tibble        3.3.1      2026-01-11 [1] CRAN (R 4.5.2)
 tidyselect    1.2.1      2024-03-11 [1] CRAN (R 4.5.0)
 vctrs         0.7.3      2026-04-11 [1] CRAN (R 4.5.2)
 withr         3.0.2      2024-10-28 [1] CRAN (R 4.5.0)
 xfun          0.56       2026-01-18 [1] CRAN (R 4.5.2)
 yaml          2.3.12     2025-12-10 [1] CRAN (R 4.5.2)

 [1] /Library/Frameworks/R.framework/Versions/4.5-arm64/Resources/library

─ Python configuration ─────────────────────────────────────────────
 python:         ~/Library/Caches/org.R-project.R/R/reticulate/uv/cache/archive-v0/tRGbCmZuWBz-sILj/bin/python
 libpython:      ~/Library/Caches/org.R-project.R/R/reticulate/uv/python/cpython-3.12.13-macos-aarch64-none/lib/libpython3.12.dylib
 pythonhome:     ~/Library/Caches/org.R-project.R/R/reticulate/uv/cache/archive-v0/tRGbCmZuWBz-sILj:~/Library/Caches/org.R-project.R/R/reticulate/uv/cache/archive-v0/tRGbCmZuWBz-sILj
 virtualenv:     ~/Library/Caches/org.R-project.R/R/reticulate/uv/cache/archive-v0/tRGbCmZuWBz-sILj/bin/activate_this.py
 version:        3.12.13 (main, Jun  2 2026, 22:42:28) [Clang 22.1.3 ]
 numpy:          ~/Library/Caches/org.R-project.R/R/reticulate/uv/cache/archive-v0/tRGbCmZuWBz-sILj/lib/python3.12/site-packages/numpy
 numpy_version:  2.4.6

 NOTE: Python version was forced by py_require()

────────────────────────────────────────────────────────────────────