Skip to content
Prev 303234 / 398503 Next

named character question

You are treating add1 as a vector of characters. If you want the zipcode and
you know what positions it is within the string use

substr(add1[1], 32, 36)

If you don't know, you could use (but it will get any 5 digit number):

regmatches(add1, regexpr("[[:digit:]]{5}", add1))

----------------------------------------------
David L Carlson
Associate Professor of Anthropology
Texas A&M University
College Station, TX 77843-4352