I think your approach does not cater to R's strengths, nor make use of excellent libraries, like the tidyverse, that further simplify data manipulations. It feels like you are trying to 'brute force' the data by manually forcing it into a matrix.
(One hint is that if you're trying to loop, rather than use vectorized manipulations, you might be going about things in a more complicated way than needed.)
Are you trying to group by some factor (like states or regions or year) and then obtain sums of particular columns?
If so, it would be helpful for you to clarify exactly what you are trying to accomplish, if you want folks to help.
I think it'd take longer to work through your (currently nonfunctioning) code to figure out what your goal is, than to actually write a little bit of 'tidyverse'-compatible code to do the manipulations in dataframes.
As a start, to get your data and regions into an analyzable dataframe, I'd start with:
library(tidyverse)
df <- read.csv(file = '~/Desktop/PRODUC.csv') %>%
mutate(
region = case_when( # add a 'region' column, based on the state
ST_ABB %in% c('AL', 'FL', 'LA', 'MS') ~ 'gulf',
ST_ABB %in% c('IL', 'IN', 'KY', 'MI', 'MN', 'OH', 'WI') ~ 'midwest',
ST_ABB %in% c('DE', 'MD', 'NJ', 'NY', 'PA', 'VA') ~ 'mid_atlantic',
ST_ABB %in% c('CO', 'ID', 'MT', 'ND', 'SD', 'WY') ~ 'MOUNTAIN',
ST_ABB %in% c('CT', 'ME', 'MA', 'NH', 'RI', 'VT') ~ 'NEW_ENGLAND',
ST_ABB %in% c('GA', 'NC', 'SC', 'TN', 'WV', 'RI') ~ 'SOUTH',
ST_ABB %in% c('AZ', 'NV', 'NM', 'TX', 'UT') ~ 'SOUTHWEST',
ST_ABB %in% c('AK', 'IA', 'KS', 'MO', 'NE', 'OK') ~ 'CENTRAL',
ST_ABB %in% c('CA', 'OR', 'WA') ~ 'WEST_COAST'
)
)
Then, you could explore tidyverse's "group_by" followed by "summarize" manipulations to start to get the column-wise manipulations done.