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 8707145
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T03:47:46+00:00 2026-06-13T03:47:46+00:00

Since my other question got closed, here is the required data. What I’m trying

  • 0

Since my other question got closed, here is the required data.
What I’m trying to do is have R calculate the last column ‘count’ towards the column city so I can map the data. Therefore I would need some kind of code to match this. Since I want to show how many participants (in count) are in the state of e.g Hawaii (HI)

zip     city         state  latitude    longitude   count
96860   Pearl Harbor    HI  24.859832   -168.021815 36
96863   Kaneohe Bay     HI  21.439867   -157.74772  39
99501   Anchorage       AK  61.216799   -149.87828  12
99502   Anchorage       AK  61.153693   -149.95932  17
99506   Elmendorf AFB   AK  61.224384   -149.77461  2

what I’ve tried is

match<- c(match(datazip$state, datazip$number))>$

but I’m really helpless trying to find a solution since I don’t even know how to describe this in short. My plan afterwards is to make choropleth map with the data and believe me by now I’ve seen almost all the pages that try to give advice. so your help is pretty much appreciated. Thanks

  • 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-06-13T03:47:47+00:00Added an answer on June 13, 2026 at 3:47 am
    # I read your sample data to a data frame
    > df
        zip          city state latitude longitude count
    1 96860  Pearl_Harbor    HI 24.85983 -168.0218    36
    2 96863   Kaneohe_Bay    HI 21.43987 -157.7477    39
    3 99501     Anchorage    AK 61.21680 -149.8783    12
    4 99502     Anchorage    AK 61.15369 -149.9593    17
    5 99506 Elmendorf_AFB    AK 61.22438 -149.7746     2
    
    # If you want to sum the number of counts by state
    library(plyr)
    > ddply(df, .(state), transform, count2 = sum(count))
        zip          city state latitude longitude count count2
    1 99501     Anchorage    AK 61.21680 -149.8783    12     31
    2 99502     Anchorage    AK 61.15369 -149.9593    17     31
    3 99506 Elmendorf_AFB    AK 61.22438 -149.7746     2     31
    4 96860  Pearl_Harbor    HI 24.85983 -168.0218    36     75
    5 96863   Kaneohe_Bay    HI 21.43987 -157.7477    39     75
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Since my other bug got solved, I'm posting a new question for this bug.
I want a Python object that will monitor whether other objects have changed since
this question is very similar to many other questions posted on stack overflow,I have
Simple question here; I've got a list of stop words in a CSV text
Since I got my spaces replaced with &nbsp; 's, the previous question is answered,
Hi just a quick question here I got an account on www.assembla.com which is
I've checked the other posts, but non seem to answer my question, so here
I have a question regarding CreateMutex() I am working on image data, and do
Background This question got me thinking about something. Lately, since I've been looking at
Yesterday I asked a question here that got more momentum that what I thought

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.