Package 'nycdemog'

Title: New York City Demographic Data from the Census
Description: County-, tract-, and block-level demographic data for the five counties of New York City, derived from the US Census Bureau via 'tidycensus'. Provides curated tibbles keyed by GEOID and thin wrapper functions for fetching custom NYC slices on demand.
Authors: Kieran Healy [aut, cre] (ORCID: <https://orcid.org/0000-0001-9114-981X>)
Maintainer: Kieran Healy <[email protected]>
License: MIT + file LICENSE
Version: 0.0.3
Built: 2026-10-07 09:08:24 UTC
Source: https://github.com/kjhealy/nycdemog

Help Index


Get American Community Survey data for New York City

Description

A thin wrapper around tidycensus::get_acs() that hard-codes New York City geographies, never downloads geometry, and returns a tidy tibble keyed by geoid (lowercased) with a county column (borough name) ready for joining to the spatial objects in the nycmaps package.

Usage

get_nyc_acs(
  variables,
  year = NULL,
  geography = c("tract", "block group", "county", "puma"),
  survey = "acs5",
  summary_var = NULL,
  output = c("wide", "tidy"),
  ...
)

Arguments

variables

A character vector (optionally named) of Census variable IDs. See load_nyc_variables() or tidycensus::load_variables().

year

ACS endyear. If NULL (the default), uses the tidycensus::get_acs() default, which is the most recent vintage that tidycensus supports.

geography

Geographic level. One of "tract" (default), "block group", "county", or "puma". For "tract", "block group", and "county" the request is restricted to the five NYC counties via tidycensus's county argument. For "puma", tidycensus does not accept a county filter, so all NY state PUMAs are requested and then filtered down to the 55 NYC PUMAs using an internal crosswalk. The crosswalk vintage is chosen from year: ACS endyears up to and including 2021 use the 2010 PUMA vintage, 2022 and later use the 2020 vintage. See nyc_pumas().

survey

ACS sample, passed to tidycensus::get_acs(). Defaults to "acs5".

summary_var

Optional summary (denominator) variable.

output

"wide" (the default) or "tidy". When "wide", the variable column is pivoted out so each variable becomes its own column.

...

Additional arguments forwarded to tidycensus::get_acs().

Value

A tibble with geoid and county as the first two columns, followed by the requested variables. The ACS endyear actually used is stored in the "acs_year" attribute.

See Also

get_nyc_decennial(), load_nyc_variables(), nyc_counties(), nyc_pumas()

Examples

## Not run: 
# Median household income, latest 5-year ACS, NYC tracts.
get_nyc_acs(c(med_hhinc = "B19013_001"))

# Same, but at the PUMA level.
get_nyc_acs(
  c(med_hhinc = "B19013_001"),
  geography = "puma"
)

# Same, but one row per borough.
get_nyc_acs(
  c(med_hhinc = "B19013_001"),
  geography = "county"
)

# Race and Hispanic origin, with total population as the denominator.
race_vars <- c(
  nh_white = "B03002_003",
  nh_black = "B03002_004",
  nh_asian = "B03002_006",
  hispanic = "B03002_012"
)
get_nyc_acs(race_vars, summary_var = "B03002_001")

## End(Not run)

Get Decennial Census data for New York City

Description

A thin wrapper around tidycensus::get_decennial() that hard-codes the five New York City counties, never downloads geometry, and returns a tidy tibble keyed by geoid (lowercased) with a county column ready for joining to the spatial objects in the nycmaps package.

Usage

get_nyc_decennial(
  variables,
  year = 2020,
  geography = c("tract", "block", "block group", "county"),
  sumfile = "pl",
  summary_var = NULL,
  output = c("wide", "tidy"),
  ...
)

Arguments

variables

A character vector (optionally named) of Census variable IDs. See load_nyc_variables() or tidycensus::load_variables().

year

Decennial Census year. Defaults to 2020. 2000 and 2010 are also accepted by tidycensus.

geography

Geographic level. One of "tract" (default), "block", "block group", or "county".

sumfile

Census summary file. Defaults to "pl" (the redistricting file). For tract-level demographic and housing characteristics use "dhc".

summary_var

Optional summary (denominator) variable.

output

"wide" (the default) or "tidy".

...

Additional arguments forwarded to tidycensus::get_decennial().

Value

A tibble with geoid and county as the first two columns, followed by the requested variables. The Census year and sumfile used are stored in the "decennial_year" and "decennial_sumfile" attributes.

See Also

get_nyc_acs(), load_nyc_variables(), nyc_counties()

Examples

## Not run: 
# 2020 PL 94-171 race and Hispanic origin at the block level.
race_vars <- c(
  nh_white = "P2_005N",
  nh_black = "P2_006N",
  nh_asian = "P2_008N",
  hispanic = "P2_002N"
)
get_nyc_decennial(
  race_vars,
  geography = "block",
  sumfile = "pl",
  summary_var = "P1_001N"
)

# 2020 DHC household type at tract level.
get_nyc_decennial(
  c(family_hh = "H9_002N", nonfamily_hh = "H9_009N"),
  geography = "tract",
  sumfile = "dhc"
)

# 2020 PL 94-171 total population, one row per borough.
get_nyc_decennial(
  c(total_pop = "P1_001N"),
  geography = "county",
  sumfile = "pl"
)

## End(Not run)

Look up Census variables

Description

Convenience wrapper around tidycensus::load_variables() for browsing the variable catalogues used by get_nyc_acs() and get_nyc_decennial(). The result is identical to a direct tidycensus call; this function exists so that all NYC-oriented Census helpers live in one place.

Usage

load_nyc_variables(year, dataset, cache = TRUE)

Arguments

year

The year, or endyear, of the dataset.

dataset

Dataset name. Common choices: "acs5", "pl", "dhc", "sf1". See tidycensus::load_variables() for the full list.

cache

Whether to cache the variable table on disk for re-use across sessions. Defaults to TRUE (the opposite of the upstream default, because caching is almost always what you want during package work).

Value

A tibble of variable IDs, labels, and concepts.

Examples

## Not run: 
acs <- load_nyc_variables(2023, "acs5")
dplyr::filter(acs, grepl("median household income", label, ignore.case = TRUE))

## End(Not run)

New York City adults and children by Census block, 2020

Description

Population aged 18 and over (and the derived population under 18) for the five New York City counties at the 2020 Census block level. Sourced from the 2020 Decennial Census PL 94-171 redistricting summary file. Joins to nycmaps::nyc_census_blocks_2020_sf on geoid.

Usage

nyc_block_20_adults_df

Format

A tibble with 37,984 rows and 6 columns:

geoid

15-character block GEOID.

county

NYC county (borough) name derived from geoid.

name

Census block label as returned by the Census Bureau.

total_pop

Total population of the block (P1_001N).

adults

Population aged 18 and over (P3_001N).

children

Population under 18, computed as total_pop - adults.

Source

US Census Bureau, 2020 Decennial Census, PL 94-171 Redistricting Data Summary File. Retrieved via tidycensus::get_decennial(). https://www.census.gov/programs-surveys/decennial-census/about/rdo/summary-files.html


New York City race and Hispanic origin by Census block, 2020

Description

Population counts for the five New York City counties at the 2020 Census block level, broken down by race and Hispanic origin. Sourced from the 2020 Decennial Census PL 94-171 redistricting summary file. Joins to nycmaps::nyc_census_blocks_2020_sf on geoid.

Usage

nyc_block_20_race_df

Format

A tibble with 37,984 rows and 25 columns:

geoid

15-character block GEOID (state + county + tract + block).

county

NYC county (borough) name derived from geoid.

name

Census block label as returned by the Census Bureau.

total_pop

Total population of the block (PL summary variable P1_001N).

white_alone

Population reporting White alone (P1_003N).

black_alone

Population reporting Black or African American alone (P1_004N).

aian_alone

American Indian and Alaska Native alone (P1_005N).

asian_alone

Asian alone (P1_006N).

hipi_alone

Native Hawaiian and Other Pacific Islander alone (P1_007N).

other_alone

Some other race alone (P1_008N).

two_or_more

Two or more races (P1_009N).

hispanic

Hispanic or Latino population (P2_002N).

non_hispanic

Not Hispanic or Latino population (P2_003N).

nh_white_alone

Not Hispanic, White alone (P2_005N).

nh_black_alone

Not Hispanic, Black or African American alone (P2_006N).

nh_aian_alone

Not Hispanic, AIAN alone (P2_007N).

nh_asian_alone

Not Hispanic, Asian alone (P2_008N).

nh_hipi_alone

Not Hispanic, NHOPI alone (P2_009N).

nh_other_alone

Not Hispanic, some other race alone (P2_010N).

nh_two_or_more

Not Hispanic, two or more races (P2_011N).

nh_white_prop

Proportion of total_pop that is non-Hispanic White alone. NA when total_pop == 0.

nh_black_prop

Proportion non-Hispanic Black alone.

nh_asian_prop

Proportion non-Hispanic Asian alone.

hispanic_prop

Proportion Hispanic or Latino.

nh_two_or_more_prop

Proportion non-Hispanic two or more races.

Source

US Census Bureau, 2020 Decennial Census, PL 94-171 Redistricting Data Summary File. Retrieved via tidycensus::get_decennial(). https://www.census.gov/programs-surveys/decennial-census/about/rdo/summary-files.html


New York City county names

Description

The five counties (boroughs) that make up New York City, in the form expected by tidycensus::get_acs() and tidycensus::get_decennial() (i.e. county names, not FIPS codes).

Usage

nyc_counties()

Value

A character vector of length 5: "New York", "Kings", "Queens", "Bronx", "Richmond".

Examples

nyc_counties()

New York City adults and children by county, 2020

Description

Population aged 18 and over (and the derived population under 18) for the five New York City counties (boroughs). Sourced from the 2020 Decennial Census PL 94-171 redistricting summary file. The county-level counterpart of nyc_block_20_adults_df. Joins to nycmaps::nyc_boros_sf via the county column, which matches nycmaps::nyc_boros$short_county_name.

Usage

nyc_county_20_adults_df

Format

A tibble with 5 rows and 6 columns:

geoid

5-character county GEOID.

county

NYC county (borough) name derived from geoid.

name

County label as returned by the Census Bureau.

total_pop

Total population of the county (P1_001N).

adults

Population aged 18 and over (P3_001N).

children

Population under 18, computed as total_pop - adults.

Source

US Census Bureau, 2020 Decennial Census, PL 94-171 Redistricting Data Summary File. Retrieved via tidycensus::get_decennial(). https://www.census.gov/programs-surveys/decennial-census/about/rdo/summary-files.html


New York City sex and age by county, 2020

Description

Total population, sex, and ten standard age bins for the five New York City counties (boroughs). Sourced from the 2020 Decennial Census Demographic and Housing Characteristics (DHC) file, table P12 ("Sex by age for selected age categories"). Each age bin is the sum of the corresponding male and female detail categories from P12, so the bins sum exactly to total_pop and male + female equals total_pop. The county-level counterpart of nyc_tract_20_age_sex_df. Joins to nycmaps::nyc_boros_sf via the county column, which matches nycmaps::nyc_boros$short_county_name.

Usage

nyc_county_20_age_sex_df

Format

A tibble with 5 rows and 16 columns:

geoid

5-character county GEOID (state + county).

county

NYC county (borough) name derived from geoid.

name

County label as returned by the Census Bureau.

total_pop

Total population (P12_001N).

male

Male population (P12_002N).

female

Female population (P12_026N).

age_under_5

Population aged under 5.

age_5_17

Population aged 5 to 17.

age_18_24

Population aged 18 to 24.

age_25_34

Population aged 25 to 34.

age_35_44

Population aged 35 to 44.

age_45_54

Population aged 45 to 54.

age_55_64

Population aged 55 to 64.

age_65_74

Population aged 65 to 74.

age_75_84

Population aged 75 to 84.

age_85_plus

Population aged 85 and over.

Source

US Census Bureau, 2020 Decennial Census, Demographic and Housing Characteristics (DHC) File, table P12. Retrieved via tidycensus::get_decennial(). https://www.census.gov/data/tables/2023/dec/2020-census-dhc.html


New York City household type by county, 2020

Description

Household counts by type for the five New York City counties (boroughs). Sourced from the 2020 Decennial Census Demographic and Housing Characteristics (DHC) file, table P16 ("Household type"). The family / non-family split sums exactly to total_households. The county-level counterpart of nyc_tract_20_household_df. Joins to nycmaps::nyc_boros_sf via the county column, which matches nycmaps::nyc_boros$short_county_name.

Usage

nyc_county_20_household_df

Format

A tibble with 5 rows and 14 columns:

geoid

5-character county GEOID.

county

NYC county (borough) name derived from geoid.

name

County label as returned by the Census Bureau.

total_households

Total occupied housing units (P16_001N).

family_households

Family households (P16_002N).

married_couple

Married-couple family households (P16_003N).

other_family

Other family households (P16_004N).

male_householder_no_spouse

Male householder, no spouse present (P16_005N).

female_householder_no_spouse

Female householder, no spouse present (P16_006N).

nonfamily_households

Non-family households (P16_007N).

living_alone

Householder living alone (P16_008N).

not_living_alone

Non-family householder not living alone (P16_009N).

family_prop

Proportion of households that are family households. NA when total_households == 0.

living_alone_prop

Proportion of households whose householder is living alone.

Source

US Census Bureau, 2020 Decennial Census, Demographic and Housing Characteristics (DHC) File, table P16. Retrieved via tidycensus::get_decennial(). https://www.census.gov/data/tables/2023/dec/2020-census-dhc.html


New York City race and Hispanic origin by county, 2020

Description

Population counts for the five New York City counties (boroughs), broken down by race and Hispanic origin. Sourced from the 2020 Decennial Census PL 94-171 redistricting summary file. The county-level counterpart of nyc_block_20_race_df. Joins to nycmaps::nyc_boros_sf via the county column, which matches nycmaps::nyc_boros$short_county_name.

Usage

nyc_county_20_race_df

Format

A tibble with 5 rows and 25 columns:

geoid

5-character county GEOID (state + county).

county

NYC county (borough) name derived from geoid.

name

County label as returned by the Census Bureau, e.g. "Kings County, New York".

total_pop

Total population of the county (PL summary variable P1_001N).

white_alone

Population reporting White alone (P1_003N).

black_alone

Population reporting Black or African American alone (P1_004N).

aian_alone

American Indian and Alaska Native alone (P1_005N).

asian_alone

Asian alone (P1_006N).

hipi_alone

Native Hawaiian and Other Pacific Islander alone (P1_007N).

other_alone

Some other race alone (P1_008N).

two_or_more

Two or more races (P1_009N).

hispanic

Hispanic or Latino population (P2_002N).

non_hispanic

Not Hispanic or Latino population (P2_003N).

nh_white_alone

Not Hispanic, White alone (P2_005N).

nh_black_alone

Not Hispanic, Black or African American alone (P2_006N).

nh_aian_alone

Not Hispanic, AIAN alone (P2_007N).

nh_asian_alone

Not Hispanic, Asian alone (P2_008N).

nh_hipi_alone

Not Hispanic, NHOPI alone (P2_009N).

nh_other_alone

Not Hispanic, some other race alone (P2_010N).

nh_two_or_more

Not Hispanic, two or more races (P2_011N).

nh_white_prop

Proportion of total_pop that is non-Hispanic White alone. NA when total_pop == 0.

nh_black_prop

Proportion non-Hispanic Black alone.

nh_asian_prop

Proportion non-Hispanic Asian alone.

hispanic_prop

Proportion Hispanic or Latino.

nh_two_or_more_prop

Proportion non-Hispanic two or more races.

Source

US Census Bureau, 2020 Decennial Census, PL 94-171 Redistricting Data Summary File. Retrieved via tidycensus::get_decennial(). https://www.census.gov/programs-surveys/decennial-census/about/rdo/summary-files.html


New York City educational attainment by county, ACS 5-year

Description

Educational attainment for the population 25 years and over from the 2020-2024 American Community Survey 5-year release for the five New York City counties (boroughs). Sourced from ACS table B15003. Each estimate is accompanied by its 90% margin of error, with the suffix ⁠_moe⁠. The county-level counterpart of nyc_tract_acs_education_df. Joins to nycmaps::nyc_boros_sf via the county column, which matches nycmaps::nyc_boros$short_county_name.

Usage

nyc_county_acs_education_df

Format

A tibble with 5 rows and 26 columns:

geoid

5-character county GEOID.

county

NYC county (borough) name derived from geoid.

name

County label as returned by the Census Bureau.

edu_total

Population 25 years and over (B15003_001).

edu_less_than_hs

No schooling completed (B15003_002).

edu_some_hs

9th to 12th grade, no diploma (B15003_016).

edu_hs

Regular high school diploma (B15003_017).

edu_some_college

Some college, 1 or more years, no degree (B15003_019).

edu_associates

Associate's degree (B15003_021).

edu_bachelors

Bachelor's degree (B15003_022).

edu_masters

Master's degree (B15003_023).

edu_professional

Professional school degree (B15003_024).

edu_doctorate

Doctorate degree (B15003_025).

edu_total_moe, edu_less_than_hs_moe, edu_some_hs_moe, edu_hs_moe, edu_some_college_moe, edu_associates_moe, edu_bachelors_moe, edu_masters_moe, edu_professional_moe, edu_doctorate_moe

Margins of error for the corresponding estimates.

bachelors_or_higher

edu_bachelors + edu_masters + edu_professional + edu_doctorate.

bachelors_or_higher_prop

Proportion of edu_total with a bachelor's degree or higher. NA when edu_total == 0.

less_than_hs_prop

Proportion of edu_total whose highest attainment is below a high school diploma.

Source

US Census Bureau, 2020-2024 American Community Survey 5-year estimates, table B15003. Retrieved via tidycensus::get_acs(). https://www.census.gov/programs-surveys/acs


New York City labor force status by county, ACS 5-year

Description

Labor force status estimates from the 2020-2024 American Community Survey 5-year release for the five New York City counties (boroughs). Sourced from ACS table B23025 ("Employment status for the population 16 years and over"). Each estimate is accompanied by its 90% margin of error, with the suffix ⁠_moe⁠. The county-level counterpart of nyc_tract_acs_employment_df. Joins to nycmaps::nyc_boros_sf via the county column, which matches nycmaps::nyc_boros$short_county_name.

Usage

nyc_county_acs_employment_df

Format

A tibble with 5 rows and 19 columns:

geoid

5-character county GEOID.

county

NYC county (borough) name derived from geoid.

name

County label as returned by the Census Bureau.

lf_total

Population 16 years and over (B23025_001).

lf_in_labor_force

In labor force (B23025_002).

lf_civilian

Civilian labor force (B23025_003).

lf_employed

Civilian employed (B23025_004).

lf_unemployed

Civilian unemployed (B23025_005).

lf_armed_forces

Armed forces (B23025_006).

lf_not_in_labor_force

Not in labor force (B23025_007).

lf_total_moe, lf_in_labor_force_moe, lf_civilian_moe, lf_employed_moe, lf_unemployed_moe, lf_armed_forces_moe, lf_not_in_labor_force_moe

Margins of error for the corresponding estimates.

labor_force_participation

lf_in_labor_force / lf_total. NA when lf_total == 0.

unemployment_rate

lf_unemployed / lf_civilian. NA when lf_civilian == 0.

Source

US Census Bureau, 2020-2024 American Community Survey 5-year estimates, table B23025. Retrieved via tidycensus::get_acs(). https://www.census.gov/programs-surveys/acs


New York City housing units, tenure, and value by county, ACS 5-year

Description

Housing-unit counts, occupancy, tenure, value, rent, and year built from the 2020-2024 American Community Survey 5-year release for the five New York City counties (boroughs). Each estimate is accompanied by its 90% margin of error, with the suffix ⁠_moe⁠. The county-level counterpart of nyc_tract_acs_housing_df. Joins to nycmaps::nyc_boros_sf via the county column, which matches nycmaps::nyc_boros$short_county_name.

Usage

nyc_county_acs_housing_df

Format

A tibble with 5 rows and 23 columns:

geoid

5-character county GEOID.

county

NYC county (borough) name derived from geoid.

name

County label as returned by the Census Bureau.

hu_total

Total housing units (B25001_001).

hu_occupied

Occupied housing units (B25002_002).

hu_vacant

Vacant housing units (B25002_003).

tenure_total

Occupied housing units, tenure denominator (B25003_001).

tenure_owner

Owner-occupied units (B25003_002).

tenure_renter

Renter-occupied units (B25003_003).

median_value

Median value of owner-occupied housing units, dollars (B25077_001).

median_gross_rent

Median gross rent, dollars (B25064_001).

median_year_built

Median year structure built (B25035_001).

hu_total_moe, hu_occupied_moe, hu_vacant_moe, tenure_total_moe, tenure_owner_moe, tenure_renter_moe, median_value_moe, median_gross_rent_moe, median_year_built_moe

Margins of error for the corresponding estimates.

owner_occupied_prop

tenure_owner / tenure_total. NA when tenure_total == 0.

vacancy_rate

hu_vacant / hu_total. NA when hu_total == 0.

Source

US Census Bureau, 2020-2024 American Community Survey 5-year estimates, tables B25001, B25002, B25003, B25035, B25064, B25077. Retrieved via tidycensus::get_acs(). https://www.census.gov/programs-surveys/acs


New York City income, poverty, and inequality by county, ACS 5-year

Description

Income, poverty, and inequality estimates from the 2020-2024 American Community Survey 5-year release for the five New York City counties (boroughs). Each estimate is accompanied by its 90% margin of error, with the suffix ⁠_moe⁠. The county-level counterpart of nyc_tract_acs_income_df. Joins to nycmaps::nyc_boros_sf via the county column, which matches nycmaps::nyc_boros$short_county_name.

Usage

nyc_county_acs_income_df

Format

A tibble with 5 rows and 16 columns:

geoid

5-character county GEOID.

county

NYC county (borough) name derived from geoid.

name

County label as returned by the Census Bureau.

med_hhinc

Median household income, inflation-adjusted dollars (B19013_001).

med_family_income

Median family income (B19113_001).

per_capita_income

Per capita income (B19301_001).

gini

Gini index of income inequality (B19083_001).

poverty_total

Population for whom poverty status is determined (B17001_001).

poverty_below

Population with income in the past 12 months below the poverty level (B17001_002).

med_hhinc_moe, med_family_income_moe, per_capita_income_moe, gini_moe, poverty_total_moe, poverty_below_moe

Margins of error for the corresponding estimates.

poverty_rate

poverty_below / poverty_total. NA when poverty_total == 0.

Source

US Census Bureau, 2020-2024 American Community Survey 5-year estimates, tables B19013, B19113, B19301, B19083, B17001. Retrieved via tidycensus::get_acs(). https://www.census.gov/programs-surveys/acs


New York City language and nativity by county, ACS 5-year

Description

Language spoken at home and place of birth / citizenship from the 2020-2024 American Community Survey 5-year release for the five New York City counties (boroughs). Sourced from ACS tables B16001 (language spoken at home) and B05002 (place of birth and citizenship). Each estimate is accompanied by its 90% margin of error, with the suffix ⁠_moe⁠. The county-level counterpart of nyc_tract_acs_language_nativity_df. Joins to nycmaps::nyc_boros_sf via the county column, which matches nycmaps::nyc_boros$short_county_name.

Usage

nyc_county_acs_language_nativity_df

Format

A tibble with 5 rows and 21 columns:

geoid

5-character county GEOID.

county

NYC county (borough) name derived from geoid.

name

County label as returned by the Census Bureau.

lang_total

Population 5 years and over (B16001_001).

lang_english_only

Speaks English only at home (B16001_002).

lang_spanish

Speaks Spanish at home (B16001_003).

nativity_total

Total population, nativity universe (B05002_001).

native

Native-born population (B05002_002).

foreign_born

Foreign-born population (B05002_013).

naturalized

Foreign-born, naturalized US citizen (B05002_014).

not_citizen

Foreign-born, not a US citizen (B05002_021).

lang_total_moe, lang_english_only_moe, lang_spanish_moe, nativity_total_moe, native_moe, foreign_born_moe, naturalized_moe, not_citizen_moe

Margins of error for the corresponding estimates.

english_only_prop

lang_english_only / lang_total. NA when lang_total == 0.

foreign_born_prop

foreign_born / nativity_total. NA when nativity_total == 0.

Source

US Census Bureau, 2020-2024 American Community Survey 5-year estimates, tables B16001 and B05002. Retrieved via tidycensus::get_acs(). https://www.census.gov/programs-surveys/acs


New York City race and Hispanic origin by county, ACS 5-year

Description

Race and Hispanic-origin estimates from the 2020-2024 American Community Survey 5-year release for the five New York City counties (boroughs). Sourced from ACS table B03002 ("Hispanic or Latino origin by race"), with B03002_001 as the population denominator. Each estimate is accompanied by its 90% margin of error, with the suffix ⁠_moe⁠. The county-level counterpart of nyc_tract_acs_race_df. Joins to nycmaps::nyc_boros_sf via the county column, which matches nycmaps::nyc_boros$short_county_name.

Usage

nyc_county_acs_race_df

Format

A tibble with 5 rows and 25 columns:

geoid

5-character county GEOID.

county

NYC county (borough) name derived from geoid.

name

County label as returned by the Census Bureau.

total_pop

Total population (B03002_001 summary estimate).

total_pop_moe

Margin of error for total_pop.

nh_white

Not Hispanic, White alone (B03002_003).

nh_black

Not Hispanic, Black or African American alone (B03002_004).

nh_aian

Not Hispanic, American Indian and Alaska Native alone (B03002_005).

nh_asian

Not Hispanic, Asian alone (B03002_006).

nh_hipi

Not Hispanic, Native Hawaiian and Other Pacific Islander alone (B03002_007).

nh_other

Not Hispanic, some other race alone (B03002_008).

nh_two_or_more

Not Hispanic, two or more races (B03002_009).

hispanic

Hispanic or Latino, any race (B03002_012).

nh_white_moe, nh_black_moe, nh_aian_moe, nh_asian_moe, nh_hipi_moe, nh_other_moe, nh_two_or_more_moe, hispanic_moe

Margins of error for the corresponding estimates.

nh_white_prop

Proportion non-Hispanic White. NA when total_pop == 0.

nh_black_prop

Proportion non-Hispanic Black.

nh_asian_prop

Proportion non-Hispanic Asian.

hispanic_prop

Proportion Hispanic or Latino.

Source

US Census Bureau, 2020-2024 American Community Survey 5-year estimates, table B03002. Retrieved via tidycensus::get_acs(). https://www.census.gov/programs-surveys/acs


County FIPS codes for the five New York City counties

Description

Returned as a named character vector. Useful for filtering or validating geoid columns whose first five characters encode the state + county FIPS.

Usage

nyc_county_fips()

Value

A named character vector of length 5.

Examples

nyc_county_fips()

New York City Public Use Microdata Areas (PUMAs)

Description

Returns the NYC PUMAs for a given vintage, each labelled with the borough (as a county name, matching the convention used elsewhere in this package) they fall in. NYC has 55 PUMAs in both the 2010 and 2020 vintages; the borough assignment was derived from a largest- overlap spatial join between ⁠nycmaps::nyc_pumas_*_sf⁠ and nycmaps::nyc_boros_sf and hard-coded into the package.

Usage

nyc_pumas(vintage = c("2020", "2010"))

Arguments

vintage

PUMA vintage. One of "2020" (default) or "2010".

Details

The 2010 vintage applies to ACS end-years up to and including 2021; the 2020 vintage applies to ACS end-years 2022 and later.

Value

A tibble with columns puma (5-character PUMA code), geoid (7-character state + PUMA code, as returned by tidycensus), and county (borough name as a county, e.g. "Kings").

Examples

nyc_pumas()
nyc_pumas("2010")

New York City sex and age by Census tract, 2020

Description

Total population, sex, and ten standard age bins for the five New York City counties at the 2020 Census tract level. Sourced from the 2020 Decennial Census Demographic and Housing Characteristics (DHC) file, table P12 ("Sex by age for selected age categories"). Each age bin is the sum of the corresponding male and female detail categories from P12, so the bins sum exactly to total_pop and male + female equals total_pop. Joins to nycmaps::nyc_census_tracts_2020_sf on geoid.

Usage

nyc_tract_20_age_sex_df

Format

A tibble with 2,327 rows and 16 columns:

geoid

11-character tract GEOID (state + county + tract).

county

NYC county (borough) name derived from geoid.

name

Census tract label as returned by the Census Bureau.

total_pop

Total population (P12_001N).

male

Male population (P12_002N).

female

Female population (P12_026N).

age_under_5

Population aged under 5.

age_5_17

Population aged 5 to 17.

age_18_24

Population aged 18 to 24.

age_25_34

Population aged 25 to 34.

age_35_44

Population aged 35 to 44.

age_45_54

Population aged 45 to 54.

age_55_64

Population aged 55 to 64.

age_65_74

Population aged 65 to 74.

age_75_84

Population aged 75 to 84.

age_85_plus

Population aged 85 and over.

Source

US Census Bureau, 2020 Decennial Census, Demographic and Housing Characteristics (DHC) File, table P12. Retrieved via tidycensus::get_decennial(). https://www.census.gov/data/tables/2023/dec/2020-census-dhc.html


New York City household type by Census tract, 2020

Description

Household counts by type for the five New York City counties at the 2020 Census tract level. Sourced from the 2020 Decennial Census Demographic and Housing Characteristics (DHC) file, table P16 ("Household type"). The family / non-family split sums exactly to total_households. Joins to nycmaps::nyc_census_tracts_2020_sf on geoid.

Usage

nyc_tract_20_household_df

Format

A tibble with 2,327 rows and 14 columns:

geoid

11-character tract GEOID.

county

NYC county (borough) name derived from geoid.

name

Census tract label as returned by the Census Bureau.

total_households

Total occupied housing units (P16_001N).

family_households

Family households (P16_002N).

married_couple

Married-couple family households (P16_003N).

other_family

Other family households (P16_004N).

male_householder_no_spouse

Male householder, no spouse present (P16_005N).

female_householder_no_spouse

Female householder, no spouse present (P16_006N).

nonfamily_households

Non-family households (P16_007N).

living_alone

Householder living alone (P16_008N).

not_living_alone

Non-family householder not living alone (P16_009N).

family_prop

Proportion of households that are family households. NA when total_households == 0.

living_alone_prop

Proportion of households whose householder is living alone.

Source

US Census Bureau, 2020 Decennial Census, Demographic and Housing Characteristics (DHC) File, table P16. Retrieved via tidycensus::get_decennial(). https://www.census.gov/data/tables/2023/dec/2020-census-dhc.html


New York City educational attainment by Census tract, ACS 5-year

Description

Educational attainment for the population 25 years and over from the 2020-2024 American Community Survey 5-year release for the five New York City counties at the Census tract level. Sourced from ACS table B15003. Each estimate is accompanied by its 90% margin of error, with the suffix ⁠_moe⁠. Joins to nycmaps::nyc_census_tracts_2020_sf on geoid.

Usage

nyc_tract_acs_education_df

Format

A tibble with 2,327 rows and 26 columns:

geoid

11-character tract GEOID.

county

NYC county (borough) name derived from geoid.

name

Census tract label as returned by the Census Bureau.

edu_total

Population 25 years and over (B15003_001).

edu_less_than_hs

No schooling completed (B15003_002).

edu_some_hs

9th to 12th grade, no diploma (B15003_016).

edu_hs

Regular high school diploma (B15003_017).

edu_some_college

Some college, 1 or more years, no degree (B15003_019).

edu_associates

Associate's degree (B15003_021).

edu_bachelors

Bachelor's degree (B15003_022).

edu_masters

Master's degree (B15003_023).

edu_professional

Professional school degree (B15003_024).

edu_doctorate

Doctorate degree (B15003_025).

edu_total_moe, edu_less_than_hs_moe, edu_some_hs_moe, edu_hs_moe, edu_some_college_moe, edu_associates_moe, edu_bachelors_moe, edu_masters_moe, edu_professional_moe, edu_doctorate_moe

Margins of error for the corresponding estimates.

bachelors_or_higher

edu_bachelors + edu_masters + edu_professional + edu_doctorate.

bachelors_or_higher_prop

Proportion of edu_total with a bachelor's degree or higher. NA when edu_total == 0.

less_than_hs_prop

Proportion of edu_total whose highest attainment is below a high school diploma.

Source

US Census Bureau, 2020-2024 American Community Survey 5-year estimates, table B15003. Retrieved via tidycensus::get_acs(). https://www.census.gov/programs-surveys/acs


New York City labor force status by Census tract, ACS 5-year

Description

Labor force status estimates from the 2020-2024 American Community Survey 5-year release for the five New York City counties at the Census tract level. Sourced from ACS table B23025 ("Employment status for the population 16 years and over"). Each estimate is accompanied by its 90% margin of error, with the suffix ⁠_moe⁠. Joins to nycmaps::nyc_census_tracts_2020_sf on geoid.

Usage

nyc_tract_acs_employment_df

Format

A tibble with 2,327 rows and 19 columns:

geoid

11-character tract GEOID.

county

NYC county (borough) name derived from geoid.

name

Census tract label as returned by the Census Bureau.

lf_total

Population 16 years and over (B23025_001).

lf_in_labor_force

In labor force (B23025_002).

lf_civilian

Civilian labor force (B23025_003).

lf_employed

Civilian employed (B23025_004).

lf_unemployed

Civilian unemployed (B23025_005).

lf_armed_forces

Armed forces (B23025_006).

lf_not_in_labor_force

Not in labor force (B23025_007).

lf_total_moe, lf_in_labor_force_moe, lf_civilian_moe, lf_employed_moe, lf_unemployed_moe, lf_armed_forces_moe, lf_not_in_labor_force_moe

Margins of error for the corresponding estimates.

labor_force_participation

lf_in_labor_force / lf_total. NA when lf_total == 0.

unemployment_rate

lf_unemployed / lf_civilian. NA when lf_civilian == 0.

Source

US Census Bureau, 2020-2024 American Community Survey 5-year estimates, table B23025. Retrieved via tidycensus::get_acs(). https://www.census.gov/programs-surveys/acs


New York City housing units, tenure, and value by Census tract, ACS 5-year

Description

Housing-unit counts, occupancy, tenure, value, rent, and year built from the 2020-2024 American Community Survey 5-year release for the five New York City counties at the Census tract level. Each estimate is accompanied by its 90% margin of error, with the suffix ⁠_moe⁠. Joins to nycmaps::nyc_census_tracts_2020_sf on geoid.

Usage

nyc_tract_acs_housing_df

Format

A tibble with 2,327 rows and 23 columns:

geoid

11-character tract GEOID.

county

NYC county (borough) name derived from geoid.

name

Census tract label as returned by the Census Bureau.

hu_total

Total housing units (B25001_001).

hu_occupied

Occupied housing units (B25002_002).

hu_vacant

Vacant housing units (B25002_003).

tenure_total

Occupied housing units, tenure denominator (B25003_001).

tenure_owner

Owner-occupied units (B25003_002).

tenure_renter

Renter-occupied units (B25003_003).

median_value

Median value of owner-occupied housing units, dollars (B25077_001).

median_gross_rent

Median gross rent, dollars (B25064_001).

median_year_built

Median year structure built (B25035_001).

hu_total_moe, hu_occupied_moe, hu_vacant_moe, tenure_total_moe, tenure_owner_moe, tenure_renter_moe, median_value_moe, median_gross_rent_moe, median_year_built_moe

Margins of error for the corresponding estimates.

owner_occupied_prop

tenure_owner / tenure_total. NA when tenure_total == 0.

vacancy_rate

hu_vacant / hu_total. NA when hu_total == 0.

Source

US Census Bureau, 2020-2024 American Community Survey 5-year estimates, tables B25001, B25002, B25003, B25035, B25064, B25077. Retrieved via tidycensus::get_acs(). https://www.census.gov/programs-surveys/acs


New York City income, poverty, and inequality by Census tract, ACS 5-year

Description

Income, poverty, and inequality estimates from the 2020-2024 American Community Survey 5-year release for the five New York City counties at the Census tract level. Each estimate is accompanied by its 90% margin of error, with the suffix ⁠_moe⁠. Joins to nycmaps::nyc_census_tracts_2020_sf on geoid.

Usage

nyc_tract_acs_income_df

Format

A tibble with 2,327 rows and 16 columns:

geoid

11-character tract GEOID.

county

NYC county (borough) name derived from geoid.

name

Census tract label as returned by the Census Bureau.

med_hhinc

Median household income, inflation-adjusted dollars (B19013_001).

med_family_income

Median family income (B19113_001).

per_capita_income

Per capita income (B19301_001).

gini

Gini index of income inequality (B19083_001).

poverty_total

Population for whom poverty status is determined (B17001_001).

poverty_below

Population with income in the past 12 months below the poverty level (B17001_002).

med_hhinc_moe, med_family_income_moe, per_capita_income_moe, gini_moe, poverty_total_moe, poverty_below_moe

Margins of error for the corresponding estimates.

poverty_rate

poverty_below / poverty_total. NA when poverty_total == 0.

Source

US Census Bureau, 2020-2024 American Community Survey 5-year estimates, tables B19013, B19113, B19301, B19083, B17001. Retrieved via tidycensus::get_acs(). https://www.census.gov/programs-surveys/acs


New York City language and nativity by Census tract, ACS 5-year

Description

Language spoken at home and place of birth / citizenship from the 2020-2024 American Community Survey 5-year release for the five New York City counties at the Census tract level. Sourced from ACS tables B16001 (language spoken at home) and B05002 (place of birth and citizenship). Each estimate is accompanied by its 90% margin of error, with the suffix ⁠_moe⁠. Joins to nycmaps::nyc_census_tracts_2020_sf on geoid.

Usage

nyc_tract_acs_language_nativity_df

Format

A tibble with 2,327 rows and 21 columns:

geoid

11-character tract GEOID.

county

NYC county (borough) name derived from geoid.

name

Census tract label as returned by the Census Bureau.

lang_total

Population 5 years and over (B16001_001).

lang_english_only

Speaks English only at home (B16001_002).

lang_spanish

Speaks Spanish at home (B16001_003).

nativity_total

Total population, nativity universe (B05002_001).

native

Native-born population (B05002_002).

foreign_born

Foreign-born population (B05002_013).

naturalized

Foreign-born, naturalized US citizen (B05002_014).

not_citizen

Foreign-born, not a US citizen (B05002_021).

lang_total_moe, lang_english_only_moe, lang_spanish_moe, nativity_total_moe, native_moe, foreign_born_moe, naturalized_moe, not_citizen_moe

Margins of error for the corresponding estimates.

english_only_prop

lang_english_only / lang_total. NA when lang_total == 0.

foreign_born_prop

foreign_born / nativity_total. NA when nativity_total == 0.

Source

US Census Bureau, 2020-2024 American Community Survey 5-year estimates, tables B16001 and B05002. Retrieved via tidycensus::get_acs(). https://www.census.gov/programs-surveys/acs


New York City race and Hispanic origin by Census tract, ACS 5-year

Description

Race and Hispanic-origin estimates from the 2020-2024 American Community Survey 5-year release for the five New York City counties at the Census tract level. Sourced from ACS table B03002 ("Hispanic or Latino origin by race"), with B03002_001 as the population denominator. Each estimate is accompanied by its 90% margin of error, with the suffix ⁠_moe⁠. Joins to nycmaps::nyc_census_tracts_2020_sf on geoid.

Usage

nyc_tract_acs_race_df

Format

A tibble with 2,327 rows and 25 columns:

geoid

11-character tract GEOID.

county

NYC county (borough) name derived from geoid.

name

Census tract label as returned by the Census Bureau.

total_pop

Total population (B03002_001 summary estimate).

total_pop_moe

Margin of error for total_pop.

nh_white

Not Hispanic, White alone (B03002_003).

nh_black

Not Hispanic, Black or African American alone (B03002_004).

nh_aian

Not Hispanic, American Indian and Alaska Native alone (B03002_005).

nh_asian

Not Hispanic, Asian alone (B03002_006).

nh_hipi

Not Hispanic, Native Hawaiian and Other Pacific Islander alone (B03002_007).

nh_other

Not Hispanic, some other race alone (B03002_008).

nh_two_or_more

Not Hispanic, two or more races (B03002_009).

hispanic

Hispanic or Latino, any race (B03002_012).

nh_white_moe, nh_black_moe, nh_aian_moe, nh_asian_moe, nh_hipi_moe, nh_other_moe, nh_two_or_more_moe, hispanic_moe

Margins of error for the corresponding estimates.

nh_white_prop

Proportion non-Hispanic White. NA when total_pop == 0.

nh_black_prop

Proportion non-Hispanic Black.

nh_asian_prop

Proportion non-Hispanic Asian.

hispanic_prop

Proportion Hispanic or Latino.

Source

US Census Bureau, 2020-2024 American Community Survey 5-year estimates, table B03002. Retrieved via tidycensus::get_acs(). https://www.census.gov/programs-surveys/acs