Download and Process BEA NIPA Files with Fast Row Expansion
getNIPAFiles.RdThis function downloads and processes National Income and Product Accounts (NIPA)
data files from the BEA website. It reads the necessary register files, formats the
date column, and then uses the fast stringi functions together with tidyr's unnest()
to split the combined TableId:LineNo field into separate rows and columns. Finally,
it merges the datasets.
Examples
# \donttest{
nipadata <- getNIPAFiles(type = "Q")
#> Start time: 2026-02-06 01:20:56.058559
#> Loading Q data from https://apps.bea.gov/national/Release/TXT//nipadataQ.txt
#> Formatting date column...
#> Splitting TableId:LineNo using stringi and unnesting...
#> End time: 2026-02-06 01:21:08.094141
# }