Skip to main content

Working with the New Functions

  • Chapter
  • First Online:
Book cover Working with the American Community Survey in R

Part of the book series: SpringerBriefs in Statistics ((BRIEFSSTATIST))

  • 1100 Accesses

Abstract

We’ve tried to make this User Guide as detailed as possible, to help you learn about the many advanced features of the new package. As a result, it may look like there is a lot to learn, but in fact the basics are pretty simple: to get ACS data for your own user-defined geographies, all you need to do is:

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 39.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Notes

  1. 1.

    Note: for reasons that will become clear in a moment, even a single geographic unit—say, one specific tract or county—will be wrapped up as a geo.set. Technically, each individual element in the set is known as a geo, but users will rarely (if ever) interact will individual elements such as this; wrapping all groups of geographies—even groups consisting of just one element—in geo.sets like this will help make them easier to deal with as the geographies get more complex. To avoid extra words here, I may occasionally ignore this distinction and refer to user-created geo.sets as “geos.”

  2. 2.

    This seemed preferable to simply including both matches, since all sorts of place names might match a string, and it is doubtful a user really wants them all.

  3. 3.

    But don’t fret: see Sect. 3.2.7 on page 9.

  4. 4.

    All this combining and relabeling takes place when the actual data is downloaded, so up until then you can continue to change and re-change the structure of your geo.sets.

  5. 5.

    By default, the new set will have combine=FALSE, with one exception: when adding a single-geography (i.e., length==1) to an existing set with combine= already set to TRUE, the new set will keep combine=TRUE, essentially “folding in” the new geography.

  6. 6.

    Or combine()<- and combine.term()<-, for R traditionalists…

  7. 7.

    At present, geo.lookup() only accepts and searches on state=, county=, county.subdivision=, and place=; eventually we hope to include lookup support to help find tract and block.group numbers as well.

  8. 8.

    At present, the function breaks on the first non-match, without a whole lot of help; in the future I’ll add in some better error-handling for this.

  9. 9.

    Actually, you could download data even without creating a geo.set object first—R’s evaluation procedures are perfectly happy letting you use geo.make() “on the fly” and passing the results to the acs.fetch() function: you could enter something like acs.fetch(endyear=2013, geography=geo.make(state="WA", county ="*"), table.number="B01003").

  10. 10.

    And if you haven’t, you can simply add a key= argument each time.

  11. 11.

    Note: At the request of some users, the acs package includes a special one.zero= option for the sum function, which may be desirable when aggregating lots of variables with zero-values for estimates. Since acs.fetch calls sum internally, you can set this option when you call acs.fetch and it will be passed along: for example, one could type acs.fetch(geo=my.geos, endyear=2011, table.number="B08013", one.zero=T). See help(sum-methods) for more on this.

  12. 12.

    Users may set span=1 or span=3 for other ACS products, or span=0 for Decennial data; similarly, use dataset="sf1" or dataset="sf3" for other census products.

  13. 13.

    SF3 was discontinued after 2000 and replaced with the ACS.

  14. 14.

    But don’t lose hope: see Sect. 3.3.3 on the acs.lookup() tool, which can help with this problem.

Author information

Authors and Affiliations

Authors

Rights and permissions

Reprints and permissions

Copyright information

© 2016 The Author(s)

About this chapter

Cite this chapter

Glenn, E.H. (2016). Working with the New Functions. In: Working with the American Community Survey in R. SpringerBriefs in Statistics. Springer, Cham. https://doi.org/10.1007/978-3-319-45772-7_3

Download citation

Publish with us

Policies and ethics