Analyzing NYCHA Housing Maintenance Code Violations

library(nycOpenData)
library(dplyr)
library(ggplot2)

Introduction

The NYCHA Housing Maintenance Code Violations dataset provides information about maintenance violations in public housing developments across New York City.

This dataset is important because it helps researchers, policymakers, and residents understand housing conditions and identify patterns in maintenance issues.

data

data <- nyc_ha_violations()

head(data)

Count violations by borough

data %>%
  count(boro_nm)

Visual

data %>%
  count(boro_nm) %>%
  ggplot(aes(x = boro_nm, y = n)) +
  geom_col() +
  labs(
    title = "Number of NYCHA Violations by Borough",
    x = "Borough",
    y = "Number of Violations"
  )


Try the nycOpenData package in your browser

Any scripts or data that you put into this service are public.

nycOpenData documentation built on Feb. 15, 2026, 1:07 a.m.