[acs-r] List of subgeography ids contained in a geo.set?

Ezra Haber Glenn eglenn at MIT.EDU
Mon Aug 12 15:12:23 EDT 2013


Unfortunately, you are correct: the tract IDs are fetched when actual
data is fetched.  But you could fetch a very simple table, like
table.number="B01003", which only has a single number for each, so it
won't take forever.  (And once you've done it once, you can save the
tract IDs for later use.)

> psrc=geo.make(state="WA", county=c(33,35,53,61), tract="*")
> data=acs.fetch(geography=psrc, table.number="B01003")
> psrc.tracts=geography(data)$tract

For me, the fetch only took a few seconds.

--Ezra

At Mon, 12 Aug 2013 10:10:41 -0700, Peter Schmiedeskamp wrote:
> 
> If I were looking to get a list of tract / blockgroup / block IDs back
> from a geo.set, is there a straightforward way of doing so?
> 
> For example, it might be nice to get a list of tract IDs from the
> example geo.set in the acs docs:
> 
>     > psrc <- geo.make(state="WA", county=c(33,35,53,61), tract="*")
>     > tract_ids(psrc) # made up tract_ids function
>     [1] 24300 24400 (...)
> 
> I see that, if I fetch an acs object, the @geography slot contains the
> tract attribute. However, I'm wondering if there is a way of getting
> the tracts independent of fetching a full ACS object. I'm guessing
> that the tract numbers are only fetched as the result of submitting
> the API request to the census, and perhaps there is no way to return
> an empty acs object with a NULL table number?
> 
> Cheers,
> Peter
> _______________________________________________
> acs-r mailing list
> acs-r at mit.edu
> http://mailman.mit.edu/mailman/listinfo/acs-r

--
Ezra Haber Glenn, AICP
Department of Urban Studies and Planning
Massachusetts Institute of Technology
77 Massachusetts Ave., Room 7-337
Cambridge, MA 02139
eglenn at mit.edu 
http://dusp.mit.edu/faculty/ezra-glenn | http://eglenn.scripts.mit.edu/citystate/
617.253.2024 (w)
617.721.7131 (c)


More information about the acs-r mailing list