Help with loop, csv dataset

Yup, I noticed that, too -- wasn't included in the OP's subsetting anywhere.

But it doesn't seem like the OP is actually doing anything with the regions that got defined, so I let it be.

On the plus side for this thread, this is the first time I've ever used the case_when and summarize_all functions, so I got to learn something new! Yay for Google and Stack Overflow.