Skip to contents

Phase 3CCC1. NYPD law codes are space-or-zero-padded composites of a 1-4 char statute book prefix and a numeric/alpha section identifier. Examples:

Usage

morie_parse_nypd_law_code(law_code)

Arguments

law_code

Character vector of NYPD law_code strings.

Value

A data.frame with book, section columns aligned to law_code. Length-preserving.

Details

  • "PL 1601005" -> book=PL, section=1601005 (Penal Law)

  • "VTL0511000" -> book=VTL, section=0511000

  • "AC 0019190" -> book=AC, section=0019190 (NYC Admin Code)

  • "ABC0064A00" -> book=ABC, section=0064A00

The book prefix is extracted as the leading run of uppercase ASCII letters; the section is everything after the prefix with leading whitespace stripped. NA / empty inputs return NA fields.

Examples

morie_parse_nypd_law_code(c("PL 1601005", "AC 0019190", "ABC0064A00"))
#>   book section
#> 1   PL 1601005
#> 2   AC 0019190
#> 3  ABC 0064A00