Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- library(ggmap)
- stations = read.delim('stations.tsv',
- header = T,
- sep = '\t')
- stations$lat = as.numeric(stations$lat)
- stations$long = as.numeric(stations$long)
- get_zip_from_latlong <- function(latlong) {
- zip = levels(revgeocode(as.numeric(latlong), output="more")$postal_code)
- return(zip)
- }
- stations$zip = apply(
- stations,
- c(1,2),
- get_zip_from_latlong
- )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement