library(tidycensus)
# tidy output
get_acs(
state = "NY",
geography = "county",
variables = "B01003_001",
survey = "acs5",
year = 2016,
geometry = FALSE,
output = "tidy"
)
#> Please note: `get_acs()` now defaults to a year or endyear of 2016.
#> Error: Duplicate identifiers for rows (1, 63), (2, 64), (3, 65), (4, 66), (5, 67), (6, 68), (7, 69), (8, 70), (9, 71), (10, 72), (11, 73), (12, 74), (13, 75), (14, 76), (15, 77), (16, 78), (17, 79), (18, 80), (19, 81), (20, 82), (21, 83), (22, 84), (23, 85), (24, 86), (25, 87), (26, 88), (27, 89), (28, 90), (29, 91), (30, 92), (31, 93), (32, 94), (33, 95), (34, 96), (35, 97), (36, 98), (37, 99), (38, 100), (39, 101), (40, 102), (41, 103), (42, 104), (43, 105), (44, 106), (45, 107), (46, 108), (47, 109), (48, 110), (49, 111), (50, 112), (51, 113), (52, 114), (53, 115), (54, 116), (55, 117), (56, 118), (57, 119), (58, 120), (59, 121), (60, 122), (61, 123), (62, 124)
# wide output
get_acs(
state = "NY",
geography = "county",
variables = "B01003_001",
survey = "acs5",
year = 2016,
geometry = FALSE,
output = "wide"
)
#> Please note: `get_acs()` now defaults to a year or endyear of 2016.
#> # A tibble: 62 x 4
#> GEOID NAME B01003_001E B01003_001M
#> <chr> <chr> <dbl> <dbl>
#> 1 36001 Albany County, New York 307891 NA
#> 2 36003 Allegany County, New York 47700 NA
#> 3 36005 Bronx County, New York 1436785 NA
#> 4 36007 Broome County, New York 197381 NA
#> 5 36009 Cattaraugus County, New York 78506 NA
#> 6 36011 Cayuga County, New York 78783 NA
#> 7 36013 Chautauqua County, New York 131748 NA
#> 8 36015 Chemung County, New York 87742 NA
#> 9 36017 Chenango County, New York 49286 NA
#> 10 36019 Clinton County, New York 81505 NA
#> # ... with 52 more rows