Attempting to use tidycensus package to download data.
As I read it, tidycensus supports blocks for 2000. Tract works, block group works, blocks fail
library(tidycensus)
library(tidyverse)
library(viridis)
library(ggplot2)
library(dplyr)
#------Get Decennial Census Data
ut2000tract <- get_decennial(geography = "tract", variables = "P001001",
year = 2000, sumfile = "sf1", key = mykey, state = "49", county = "035",
geometry = FALSE)
ut2000BG <- get_decennial(geography = "block group", variables =
"P001001", year = 2000, sumfile = "sf1",
key = mykey, state = "49", county = "035", geometry = FALSE)
ut2000block <- get_decennial(geography = "block", variables = "P001001",
year = 2000, sumfile = "sf1", key = mykey, state = "49", county = "035",
geometry = FALSE)
Generating the following error:
1 "Checking SF3 API for data..." 1 "Client error Bad Request Client error: (400) Bad Request" Error in stri_replace_first_regex(string, pattern, fix_replacement(replacement), : argument
str
should be a character vector (or an object coercible to) Error in gather.default(., key = variable, value = value, -GEOID, -NAME) :
object 'NAME' not found
I know block should be a valid geometry; I just want a count of population/block, which is in the Census 2000 SF1 file. Not sure why tidycensus is not working. Pulling data for 2010 seems to work. But not 2000.
totalcensus doesn't cover Census 2000