Skip to content
Prev 379622 / 398503 Next

converting zipcodes to latitude/longitude

Hi Jim,

I ended up collaborating with someone, and, on the basis of looking at
your code (we did take it into consideration and talk about it), we
came up with this:

library(stringr)
numextract <- function(string){
     str_extract(string, "\\-*\\d+\\,*\\d*")
}
myDataSet$zip<-numextract(myDataSet$state)
combineddata<-merge(zipcode, myDataSet, by.x="zip", by.y="zip")

So, as I understand it, we build a function the purpose of which was
to extract the numerical value from a string value, imputed that into
a column, then merged the two data frames together. It worked!

Now I just need to figure out this thing called shape data...basically
I need to figure out how to interpose a shape of the United States
underneath my data points so that I can see them over the location to
which they correspond.

Nicola
On Mon, May 13, 2019 at 9:09 PM Jim Lemon <drjimlemon at gmail.com> wrote: