Questions tagged [census]

187 questions
11
votes
2 answers

How to count the hamming distance of two short int?

Hamming Distance: For example, two binary number: 1011 and 1000's HD(Hamming distance) is 2. The 10000 and 01111's HD is 5. Here is the code: Can some one explain it to me? Thanks! short HammingDist(short x, short y) { short dist = 0; char val =…
David Ding
  • 680
  • 3
  • 9
  • 19
8
votes
1 answer

Retrieve Census tract from Coordinates

I have a dataset with longitude and latitude coordinates. I want to retrieve the corresponding census tract. Is there a dataset or api that would allow me to do this? My dataset looks like this: lat lon 1 40.61847 -74.02123 2…
nak5120
  • 4,089
  • 4
  • 35
  • 94
6
votes
5 answers

Zip Code Demographics in R

I could get at my goals "the long way" but am hoping to stay completely within R. I am looking to append Census demographic data by zip code to records in my database. I know that R has a few Census-based packages, but, unless I am missing…
Btibert3
  • 38,798
  • 44
  • 129
  • 168
6
votes
1 answer

choroplethr: Plotting MSA-level maps?

My question relates to plotting a whole U.S. map on MSA level via choroplethr and choroplethrZip. In the example below, we plot 1) Census population information on a U.S. map on county level and 2) a zoomed map of a selected…
Christopher
  • 2,120
  • 7
  • 31
  • 58
6
votes
2 answers

US Census API - Get The Population of Every City in a State Using Python

I'm having an issue getting the population of every city in a specific state. I do get the population of cities but if I sum the population in every city I don't get the same number as the population of the state. I got my API Key used the P0010001…
Delicious
  • 972
  • 12
  • 20
6
votes
2 answers

How to combine state-level shapefiles from the united states census bureau into a nationwide shape

The census bureau doesn't provide a nationwide shapefile of public use microdata areas (the smallest geography available on the American Community Survey). I tried combining them all with a few different methods, but even the one that de-dupes…
Anthony Damico
  • 5,779
  • 7
  • 46
  • 77
6
votes
2 answers

How to use http://www.census.gov API to pull data

Am trying to query data from http://www.census.gov, using their API I want to get the population of a particular city in the US, by using the city name and the US state code. Given that I already have the key, what other parameters do I add in the…
hyena
  • 755
  • 1
  • 14
  • 24
5
votes
2 answers

r tidycensus download all block groups

I am looking to automate the process of downloading Census data from all block groups from the US using the tidycensus package. There is instructions from the developer to download all tracts within the US, however, block groups cannot be accessed…
Geochem B
  • 418
  • 3
  • 13
5
votes
0 answers

Leaflet R performance issues with large map

I'm wondering if anyone else has experienced similar issues when plotting a large number of markers and polygons using leaflet package in R. This is what it normally should look like: However, when I zoom in/out of the map, the polygons and markers…
Sean
  • 51
  • 4
5
votes
1 answer

Creating Population Pyramid with D3.js

I need to make a classic looking population pyramid with D3.js. Something similar to this image: I have found a few examples that look really good (this and this) but they are more complex than I'm looking for. Does anyone know of a good SIMPLE…
bailey
  • 353
  • 6
  • 19
4
votes
1 answer

How do I convert from Census FIPS to Lat Lon?

I'm trying to learn some skills in programming (python) by plotting out/manipulating public data sets. Currently, I'm trying to make an interactive population map of the Arctic. I downloaded Alaskan census data from the Alaskan State Department of…
4
votes
1 answer

TopoJSON choropleth in R/Leaflet?

Is it possible to style a TopoJSON file from its features for a choropleth using R/leaflet? Tried a few things, and I'm not sure if this is impossible with the leaflet package or if I just don't have the syntax right, especially accessing the…
Nathan Thompson
  • 335
  • 1
  • 10
4
votes
3 answers

Using Census Bulk Geocoder with python requests library

I am experimenting with the census bulk geocode API documentation The following curl command works: curl --form addressFile=@Addresses.csv --form benchmark=9 http://geocoding.geo.census.gov/geocoder/locations/addressbatch --output…
Jake Lowen
  • 899
  • 1
  • 11
  • 21
4
votes
2 answers

fill rows downward for a column with NAs (with R base or data.table)

I want to use the Census' county-adjacency data, but am was stuck on getting it into a nice form. The data comes in four columns: first county, first code, second county, second code. The first county column does not repeat, and instead takes value…
Frank
  • 66,179
  • 8
  • 96
  • 180
4
votes
1 answer

Drawing maps based on census data using ggplot2

I have a list of points that I want to overlay on a map of San Francisco using ggplot2. Each point is a longitude, latitude pair. I want the resulting map to be in a longitude/latitude coordinate system. I managed to reproduce Hadley Wickham's…
Yuval F
  • 20,565
  • 5
  • 44
  • 69
1
2 3
12 13