This is an example of how to import multiple CSV files all at once. First, we download the latest version of the Flow of funds. The ZIP file contains many CSV files.

One File

Example:

# # A tibble: 10 x 3
#    date  series          value
#    <chr> <chr>           <dbl>
#  1 1946  FL154090005.A  697872
#  2 1947  FL154090005.A  745113
#  3 1948  FL154090005.A  773052
#  4 1949  FL154090005.A  796359
#  5 1950  FL154090005.A  854185
#  6 1951  FL154090005.A  927818
#  7 1952  FL154090005.A  963964
#  8 1953  FL154090005.A  994533
#  9 1954  FL154090005.A 1076464
# 10 1955  FL154090005.A 1168580

Loop

# # A tibble: 10 x 4
#    filename                 date  series        value
#    <chr>                    <chr> <chr>         <dbl>
#  1 all_sectors_levels_a.csv 1946  FL102051003.A     0
#  2 all_sectors_levels_a.csv 1947  FL102051003.A     0
#  3 all_sectors_levels_a.csv 1948  FL102051003.A     0
#  4 all_sectors_levels_a.csv 1949  FL102051003.A     0
#  5 all_sectors_levels_a.csv 1950  FL102051003.A     0
#  6 all_sectors_levels_a.csv 1951  FL102051003.A     0
#  7 all_sectors_levels_a.csv 1952  FL102051003.A     0
#  8 all_sectors_levels_a.csv 1953  FL102051003.A     0
#  9 all_sectors_levels_a.csv 1954  FL102051003.A     0
# 10 all_sectors_levels_a.csv 1955  FL102051003.A     0