Downloads the PoliceNotifications sheet from the NJ DOE School
Performance Reports. Each row reports, for one entity (state / county /
district / school depending on level), the count of incidents that
triggered a police notification, broken out by the six SPR offense
categories (violence, weapons, vandalism, substances, HIB, other).
Usage
fetch_police_notifications(
end_year,
level = "school",
with_status = FALSE,
with_denominator = FALSE
)Arguments
- end_year
A school year (2018-2025). Year is the end of the academic year - e.g. the 2023-24 school year is
end_year2024.- level
One of
"school"or"district"."school"returns school-level data;"district"returns district and state-level data.- with_status
Logical, default
FALSE. IfTRUE, appends row-levelvalue_status, classified from the raw incident-category cells before numeric coercion. A row issuppressedwhen any category is suppressed,actualwhen any category has a real number and none is suppressed, and otherwise the most honest missing-data status available.- with_denominator
Logical, default
FALSE. IfTRUE, appendsn_studentsfrom the matching total-enrollment row infetch_enronend_yearand CDS identifiers. Unmatched rows remainNA.
Value
Data frame with entity identifiers, the six incident-category
columns (violence, weapons, vandalism,
substances, hib, other_incidents), the standard aggregation flags
(is_state, is_county, is_district, is_school,
is_charter, is_charter_sector, is_allpublic).
school_year is filtered to the requested year and then removed; end_year identifies the year.
Details
Sheet coverage and harmonization:
The
PoliceNotificationssheet is present in both the School (Database_SchoolDetail.xlsx) and District/State (Database_DistrictStateDetail.xlsx) workbooks for end_year 2018-2025. It is absent from SY2016-17 (end_year 2017), so this function errors for that year.The 2024-25 redesign renamed the HIB column from
harassment_intimidation_bullying_hib(legacy) tohib; this function harmonizes both layouts tohib.The 2024-25 sheet adds a
school_yearcolumn (single value, e.g."2024-25"); it is filtered and removed. Pre-2025 sheets have noschool_yearcolumn.All six incident-category columns are returned as numeric counts. Suppressed cells (NJ DOE uses
*,N,-as suppression markers) becomeNA.
The companion analysis helper calc_discipline_rates_by_subgroup
is designed for sheets with a subgroup column and an enrollment
denominator (e.g. fetch_disciplinary_removals). The
PoliceNotifications sheet has neither (it is one row per entity, with
no subgroup breakdown and no denominator), so calc_* cannot be
applied directly; pair with fetch_enr to compute rates against
enrollment.
Examples
if (FALSE) { # \dontrun{
# School-level police notifications (latest year)
pn <- fetch_police_notifications(2025)
# District/state-level counts
pn_dist <- fetch_police_notifications(2024, level = "district")
# Districts with the most violence-related police notifications
library(dplyr)
fetch_police_notifications(2024, level = "district") %>%
filter(is_district) %>%
slice_max(violence, n = 10) %>%
select(county_name, district_name, violence, weapons, substances, hib)
} # }