Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6204199
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T05:02:51+00:00 2026-05-24T05:02:51+00:00

I have a dataframe latitude and longitude points in R. Using the R data

  • 0

I have a dataframe latitude and longitude points in R. Using the R data science toolkit, I can assign these points to Country/State/County/City/Constituency/Neighborhood, which is useful.

I’d like to assign these points to 5 digit zip-codes (or even 9 digit zip codes!) in R or python. Is there an easy way to do this?

Edit: I found a file that contains zip code boundaries. Unfortunately, it is a .lpk file. How do I import this into R?
Edit 2: I found a shape file, which will be easier to work with.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T05:02:52+00:00Added an answer on May 24, 2026 at 5:02 am
    1. Find a zip code shapefile somewhere (.shp format, sometimes called
      ArcGIS Shapefiles).

    2. Load it into R using the maptools package’s readShapePoly
      command.

    3. Create a SpatialPointsDataFrame to hold the points.

    4. Make sure your projections are correct.

    5. Use the sp package’s overlay command to overlay the points into the polygons.

    You may find cleanLatLon in the taRifx package to be helpful.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a dataframe with several columns: state county year Then x, y, and
I have a dataframe df with three variable: city , state and country .
I have a dataframe with numeric entries like this one test <- data.frame(x =
Suppose I have a dataframe like this one: df <- data.frame (id = c(a,
I have a dataframe called data where I would like to rescale the values
If you have a dataframe like this mydf <- data.frame(firstcol = c(1,2,1), secondcol =
I have a dataframe (14.5K rows by 15 columns) containing billing data from 2001
I have a dataframe: > df <- data.frame( + Species = rep(LETTERS[1:4], times=c(5,6,7,6)), +
I have a dataframe: foo <- list(df1 = data.frame(x=c('a', 'b', 'c'),y = c(1,2,3)), df2
I have a dataframe with Address, City, State, Zip entities. From there, I'm trying

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.