My day job as a real estate agent requires a myriad of skills, ranging from accounting to negotiation to business analysis. Frequently (about every three months) I whip out my marketing skills to advertise my business. This time I decided to send out postcards to an entire neighborhood in which I had sold homes recently. Typically, agents will buy a mail route from the post office and hand over their postcards. In the spirit of frugality and proving a point, I cracked my knuckles and went hunting for data.
Get the shapefiles. Wake County Open Data (or your local open data hub) has a wealth of county-level data including subdivision boundaries and individual address points. Download both shapefiles and load them into your favorite GIS program. This step can probably be done in R, but I find using QGIS fairly intuitive and much faster at plotting large shapefiles.
Filter the addresses. After loading the address and subdivision shapefiles into QGIS, clip the address shapefile using the subdivision shapefile to save the addresses of interest in a new layer. Save that puppy as a .csv and we can load it up in R.
Manipulate in R. Now we’ve got the info we want. A few lines of code will give us something the post office (or Excel) will understand.
walden_creek <- read_csv("~/Desktop/walden creek.csv") attach(walden_creek) adds <- paste(FULLADDR, POSTAL_CIT, "NC", "27523", sep = ",") detach(walden_creek) write.table(adds, "adds.csv", sep = ",")
Short and sweet, but I thought this was an interesting way to use data for a practical purpose. People seem to be using R in exciting ways these days – if you see any creative, different projects please share.
– Kiefer Smith