The following command replaces all non-digit characters in a string with empty values. The remaining characters, a string of digits, is returned.
gsub(pattern="[^0-9]",replacement="",x=c("Manhattan, KS 66502"))
gsub(pattern="[^0-9]",replacement="",x=c("M1a2n3h4a5t6t7a8n9, KS 66502"))