I downloaded PUMA mapping shapefiles for California from TIGER/line and am able to use R packages maptools, mapproj, and ggplot2 to plot maps of California with each PUMA outline as a border. My goal is to match the PUMA mapping files to ACS data I have for CA to create heat maps, (such as average income per PUMA).

However, the shapefiles have id numbers which are number 0-264 identifying each PUMA like so:

        long      lat order  hole piece  id group
1: -122.6464 38.59859     1 FALSE     1   0   0.1
2: -122.6447 38.60216     2 FALSE     1   0   0.1
3: -122.6447 38.60322     3 FALSE     1   0   0.1
4: -122.6418 38.60548     4 FALSE     1   0   0.1
5: -122.6391 38.60927     5 FALSE     1   0   0.1

[1] 0 264

[1] 265

This data I am able to map with ggplot2. For my ACS data, instead of id numbers 0-264 I have each 5 digit PUMA code, like so.

 PUMA10   percent

1: 08513 0.3647587
2: 07301 0.7857143
3: 01903 0.5035714
4: 06509 0.5312500
5: 06506 0.7687927

Each PUMA10 code corresponds to one of the PUMAs in the points file created from the .shp file.


[1] 265

However, I have so far been unable to find a file mapping the 1-3 digit id values assigned in the shapefiles with the 5-digit PUMA10 codes assigned in the ACS data download. My goal is to be able to create maps similar to proximity one. If anyone knows if such a file exists it would be most appreciated.

Thank you

1 Answer 1


There are 4 variables you are leaving out of the shapefile that was imported to R.

  1. STATEFP10 is the 2-digit FIPS code for the state.
  2. PUMACE10 is the 5-digit FIPS code for the 2010 PUMA within a state.
  3. AFFGEOID10 is the full GEOID that is unique across all levels of geography.
  4. GEOID10 is the GEOID that uniquely identifies a geographic boundary within a specific summary level. This variable (or AFFGEOID10) should be used to match between different sources. To re-create this variable in the ACS PUMS data, concatenate the State FIPS code with 2010 PUMA code (make sure that it is a string/character variable with a length of 7).
  • Thank you so much. Adding the IDvar argument to the below call solved my problem. Thank you! readShapePoly(paste0(path,"cb_2015_06_puma10_500k.shp"), IDvar = "PUMACE10")
    – S.Markind
    Jan 9, 2017 at 2:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.