Coder Social home page Coder Social logo

Comments (3)

walkerke avatar walkerke commented on August 26, 2024

Tract data is only available by state, so you'll need to supply a vector of states to the states parameter. The following code works:

st <- c(datasets::state.abb, "DC")

library(tidycensus)
tables <- c("P0030002","P0030003","P0030004","P0030005","P0030006","P0030007","P0030008")
us_tract_pop_2010<-get_decennial(geography = "tract", variables = tables, 
                                 summary_var = "P0030001", state = st)

from tidycensus.

pssguy avatar pssguy commented on August 26, 2024

Thanks that works inc a vector of all states . I was trying to work it out from your code

So if i wanted block groups I would need to enter both state and county? I tried just the states or just the county GEOIDs and get the same generic error as before

and does 1990 differ from 2000 2010
viz.
"At the moment, tracts and block groups for 1990 require specifying a county"

from tidycensus.

walkerke avatar walkerke commented on August 26, 2024

Correct, block groups are only available from the API by county. I have some logic under the hood in tidycensus to allow for multi-county calls for block groups by state; however multi-state calls would require iterating through every county in each state which I don't have built in. You could conceivably do this with purrr though you might also consider NHGIS (http://www.nhgis.org) if you want bulk block group data for the entire country.

Also: yes, the API makes tract data for 1990 only available by county, like with block groups for later years.

from tidycensus.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.