My rule of thumb, when I lived in New York, was never to live in a building with a ground floor restaurant. It didn't stop the cold weather invasions of the rats into your building, but it seemed like you were less likely to have a full scale assault.
In the past, I have told the story about moving into my first apartment in New York in Greenwich Village. After paying a security deposit, first months rent and the broker's fee for my apartment, I was flat broke and four days away from payday. I used my last six bucks to buy some bologna and a loaf of bread that I would subsist on for the next four days.
The next day, when I left for work, I made the mistake of leaving my loaf of bread on the kitchen counter. When I returned home, one of the little critters had burrowed straight through it during the course of the day. That night, in had a loser's dinner of bologna on my hand.
I woke up early the next morning carefully watching for the bread deliveries for the restaurants on my street from my fire escape. When they arrived about 5:30 am, I bolted for the street and made off with a baguette from the bread bag left on the doorstep of this incredibly bad Italian place called Ottomanelli's across the street.
Three days later, I left $3 in an envelope in Ottomanelli's doorjam and thanked them for their bread.