Quantcast
Channel: r software hub
Viewing all articles
Browse latest Browse all 1015

How to Search for Census Data from R

$
0
0

By Ari Lamstein

boxplot-japanese-residents

In my course Learn to Map Census Data in R I provide people with a handful of interesting demographics to analyze. This is convenient for teaching, but people often want to search for other demographic statistics. To address that, today I will work through an example of starting with a simple demographic question and using R to answer it.

Here is my question: I used to live in Japan, and to this day I still enjoy practicing Japanese with native speakers. If I wanted to move from San Francisco to a part of the country that has more Japanese people, where should I move?

Step 1: Find the Table for the Data

Data in the census bureau is stored in tables. One way to find the table for a particular metric is to use the function ?acs.lookup from the acs package. (Note that to run this code you will need to get and install a census API key; I explain how to do that here).

> library(acs)

> acs.lookup(keyword = "Japanese", endyear = 2013)
An object of class "acs.lookup"
endyear= 2013 ; span= 5

results:
variable.code table.number table.name variable.name
1 B02006_009 B02006 ...read more

Source:: r-bloggers.com


Viewing all articles
Browse latest Browse all 1015

Trending Articles