I am not sure what one even has to do to get mugged in NYC. And I am saying that as someone who has walked across Manhattan through Times Square on multiple occasions after midnight, all while very properly inebriated.
However, there is imo no way to avoid seeing rats if you used NYC subway more than once and had your eyelids up.