This document presents an ongoing investigation into returns to incarceration in Florida.
The Florida Department of Corrections makes its OBIS database accessible for public download here.
This document is an ongoing mining of that data. Keep an eye out for my newsletter (which doesn’t exist yet) for updates, or press F5 to refresh.
Importing
base_dir <- "/Users/johnwise/Downloads"
Root <- read_excel(paste0(base_dir, "/Inmate_Active_2023-10.XLSX"))
Incarhist <- read_excel(paste0(base_dir, "/Inmate_Active_2023-10.XLSX"), sheet = 6)
Offenses_CPS <- read_excel(paste0(base_dir, "/Inmate_Active_2023-10.XLSX"), sheet = 3)
Offenses_PRPR <- read_excel(paste0(base_dir, "/Inmate_Active_2023-10.XLSX"), sheet = 4)
first_timers <- Incarhist %>%
arrange(DCNumber, desc(ReceiptDate)) %>%
group_by(DCNumber) %>%
mutate(row_num = row_number()) %>%
filter(row_num <= 2) %>%
select(-row_num) %>%
count(DCNumber) %>%
filter(n==1)
returners <- anti_join(Incarhist, first_timers, by ='DCNumber')
# grab the two most recent receipts of those who have returned
returners_current_and_last <- returners %>%
arrange(DCNumber, desc(ReceiptDate)) %>%
group_by(DCNumber) %>%
mutate(row_num = row_number()) %>%
filter(row_num <= 2) %>%
select(-row_num)
served_prior <- returners %>%
mutate(time_served = ifelse(!is.na(ReleaseDate), as.numeric(difftime(ReleaseDate, ReceiptDate, units = "days")), NA)) %>%
group_by(DCNumber) %>%
summarize(prev_TimeServed = sum(time_served, na.rm = TRUE))
returners_time_free <- returners_current_and_last %>%
group_by(DCNumber) %>%
summarise(TimeOut = as.numeric(difftime(max(ReceiptDate, na.rm = TRUE), max(ReleaseDate, na.rm = TRUE), units = "days"))) %>% # Note, there were 7 entires for which a negative time free was calculated. Investigation shows
filter(TimeOut >= 0) # that this is due to these individuals having missing most ReceiptDate for most recent conviction.
# We omit these 7 observations for the purpose of this analysis
times_in <- returners %>%
group_by(DCNumber) %>%
summarize(times_in = n())
# Not sure why the FDOC has the individual with DC Number 872984 as initially coming to prison on 1901-01-01,
#but we will omit this individual from our analyses as well.
returners_a <- returners_a[-which(returners_a['DCNumber']=='872984'),]
# Create the 'times_in_bins' column
returners_a$times_in_bins <- cut(returners_a$times_in,
breaks = c(2, 3, 4, 6, 17),
labels = c("2 bids", "3 bids", "4-6 bids", "6-17 bids"),
include.lowest = TRUE)
# Create the 'prev_TimeServed_bins' column
breaks <- c(0, 1, 3, 5, 10, 25, 50)
labels <- c("0-1 Years", "1-3 Years", "3-5 Years", "5-10 Years", "10-25 Years", "25-50 Years")
returners_a$prev_TimeServed_bins <- cut(returners_a$prev_TimeServed / 365.25,
breaks = breaks,
labels = labels,
include.lowest = TRUE)
prop_returned <- round(dim(returners_a)[1]/dim(Root)[1],2)
mean_incarcerations <- round((sum(returners_a$times_in) + dim(first_timers)[1])/dim(Root)[1],2)
new_data <- data.frame(times_in_bins = rep("First FDOC Commitment", dim(first_timers)[1]))
combined_data <- rbind(returners_a %>% select(times_in_bins), new_data)
ggplot(combined_data, aes(x = "", fill = times_in_bins)) +
geom_bar(width = 1, stat = "count") +
coord_polar("y", start = 0) +
scale_fill_manual(values = c("#2c7bb6", "#abd9e9" ,"#ffffbf", "#fdae61", "#e6e6e6", "#7f3b00")) +
theme_void() + # Remove axis and grid lines
labs(title = "Times Incarcerated, Currently Incarcerated FDOC Population", fill = "Times FDOC Incarcerated")
Amazingly, a full 49% of our currently incarcerated population has served time previously. The Florida Department of Corrections (FDOC) seems to appreciate repeat customers; I’ve heard them say so myself. Furthermore, the average number of times a person has been incarcerated across the entire population is 2.17. In other words, the average person currently incarcerated in FDOC has been incarcerated more than twice before.
What does this information imply about the argument for incarceration as a deterrent?
Regarding the argument on incarceration as a deterrent, I pose this question: How many crimes has the threat of incarceration prevented YOU from committing?
If your answer is “none,” then you are likely in the majority.
If your response is “none, but I’m not a criminal,” then it is worth reflecting on the following: Who are the criminals? What do they look like? Where do they come from? Which neighborhoods do they reside in? How comfortable are you with your answers?
Next, we should examine the amount of time that those who are currently incarcerated in Florida were free in between their current and their last incarceration:
quartiles <- round(quantile(returners_a$TimeOut, probs = c(0.25, 0.5, 0.75))/365.25, 1)
color_palette <- c("#ffffff", "#e6e6e6", "#bfbfbf", "#808080", "#404040", "#000000")
# Create the first plot (plota)
plota <- ggplot(returners_a, aes(x = 1, y = TimeOut / 365.25, color = prev_TimeServed_bins, group = 1)) +
geom_sina(alpha = 0.5, position = 'dodge') +
geom_violin(alpha = 0.1, color = "black") +
scale_color_manual(values = color_palette, name = 'Served') +
ylab("Years Free") +
theme_void() + # Remove axis and grid lines
theme(axis.text.y = element_text()) + # Keep y-axis labels
labs(title = "Years Free, Shaded by Previous Fl. Time Served")
color_palette <- c("#ffffff", "#e6e6e6", "#404040", "#000000")
# Create the second plot (plotb)
plotb <- ggplot(returners_a, aes(x = 1, y = TimeOut / 365.25, color = times_in_bins, group = 1)) +
geom_sina(alpha = 0.5) +
geom_violin(alpha = 0.1, color = "black") +
scale_color_manual(values = color_palette, name = 'Number of Bids') +
ylab(NULL) +
theme_void() + # Remove axis and grid lines
theme(axis.text.y = element_text()) + # Keep y-axis labels
labs(title = "Years Free, Shaded by Number of Incarcerations")
# Customize plot margins for both plots
plota <- plota + theme(plot.margin = margin(0, 0, 0, 0, unit = "pt"))
plotb <- plotb + theme(plot.margin = margin(0, 0, 0, 0, unit = "pt"))
# Arrange the plots using grid.arrange
grid.arrange(plota, plotb, ncol = 2, top = "Respite Amidst Most Recent Incarcerations, Current FDOC Population")
It is evident from the visuals that a majority of individuals currently incarcerated in Florida with a history of previous FDOC incarceration did not have a significant period of freedom before their current imprisonment. Interestingly, there is also a pattern where individuals who had served long sentences in the past or multiple sentences were unable to remain free for long before being incarcerated again. These patterns are shown by the darker points towards the bottom of the visuals. While one might (naively) expect that spending more time in prison or having multiple sentences would make individuals better equipped to stay out longer and remain free, in reality it is not surprising to see evidence here that the longer someone is inside, the less equipped they are to navigate the challenges after release.
quartile_table <- data.frame(
"Quartile" = c("Q1", "Median (Q2)", "Q3"),
Years_Free = quartiles
)
kable(quartile_table) %>%
kable_styling(latex_options = "hold_position")
Quartile | Years_Free | |
---|---|---|
25% | Q1 | 1.8 |
50% | Median (Q2) | 3.2 |
75% | Q3 | 5.7 |
For individuals who are currently incarcerated and have previously served time in Florida, a quarter of them were returned to prison in less than 1.8 years after their most recent release, while half of them were not out longer than 3.2 years. Furthermore, only 25% of them managed to stay out of prison for more than 5.7 years.
It is clear that many people are going back to prison very quickly, which raises concerns.
Think about this, however: having 3.2 years of freedom is actually enough time for someone to regain some responsibilities and dignity – it is already difficult to regain these once (or maybe gain them for the first time), but to only have a fleeting taste of them? I do not know that I could recover from something like that.
returners_hist <- merge(returners_a, Offenses_CPS, by = 'DCNumber')
returners_hist$adjudicationcharge_descr <- as.factor(returners_hist$adjudicationcharge_descr)
charges <- returners_hist %>%
group_by(adjudicationcharge_descr) %>%
summarize(charge_count = n()) %>%
arrange(desc(charge_count))
raw_charges <- rbind(Offenses_CPS %>% select(adjudicationcharge_descr), Offenses_PRPR %>% select(adjudicationcharge_descr))
raw_charges$adjudicationcharge_descr <- gsub("[+$]", "", raw_charges$adjudicationcharge_descr)
raw_charges$adjudicationcharge_descr <- as.factor(raw_charges$adjudicationcharge_descr)
charges_counts <- raw_charges %>%
group_by(adjudicationcharge_descr) %>%
summarize(charge_count = n()) %>%
arrange(desc(charge_count))
Currently incarcerated individuals are associated with 1,124 different charges across all past and current incarcerations.
In order to proceed, I had to reduce these 1,124 categories to something workable, I needed more general categories of crimes – drug crimes, violent crimes, etc. Categorizing crimes is a time-consuming process that requires making multiple classification decisions, so I encourage everyone to review the crime categorizations by clicking the disclosure triangle icon next to “View Crime Category Mappings”. If any errors or inconsistencies are found, or if you wish to suggest an alternative classification framework, please don’t hesitate to contact me.
burglary_theft_keywords <- c(
'BURGUNOCCSTRUC/CV OR ATT.',
'BURG/DWELL/OCCUP.CONVEY',
'GRAND THEFT,300 L/5,000',
'GRAND THEFT MOTOR VEHICLE',
'TRAFFIC IN STOLEN PROPERTY',
'EXP ELDER DISABLD',
'BURGLARY,ARMED W/EXP. OR WEAPO',
'GRAND THEFT,$300 LESS &20,000',
'PETIT THEFT/3RD CONVICTION',
'GRAND THEFT FIREARM',
'BURGL UNOCC DWELLING',
"LAUNDER>20K<100K",
'CRIMINAL MISCHIEF/PROP.DAMAGE',
'GRAND THEFT $750+LT5K',
'BURGLARY TOOLS-POSSESS',
'GR. THEFT $100-300 DWELLING',
'BURGL OCCUPIED DWELLING',
'STOLEN CARGO',
'GRAND THEFT',
"$LAUNDER>$300<$20K",
'LARCENY FROM BUILDING',
'GRAND THEFT O/20,000 L/$100,00',
'GRAND THEFT $5KL/$10K',
'BURG/N/ASSLT/OCC.STRUCT.',
'GRAND THEFT $10K L/$20K',
'BURG.-STRUCT DAMAGE OR $1K',
'GRAND THEFT W/DAMAGE',
'GRAND THEFT O/$100K',
'GT DWELLING $100-750',
'RETAIL THEFT $300+',
'BURGL OCCUPIED CONVEYANCE',
'THEFT>65YO>$300<$10K',
'ORGANIZES THEFT PROPERTY ECT.',
'BURG/TREPASS CONSTRUCT.SITE',
'RETAIL THEFT $750+',
'GRAND THEFT O/$100,000 1ST.DEG',
'USE ANTISHOPLIFTING DEVICE',
'GRAND THEFT FRM CONST.SITE',
'BURGL-FORCED ENTRY-NONRESIDENC',
'THEFT>65YO>$50K',
'ORG RETAIL THEFT > 3K',
'BURGL-FORCED ENTRY-RESIDENCE',
'BURGL-OTHER/OTHER STATE',
'LARCENY/GRAND THEFT',
'PETIT-THEFT-MISD',
'THEFT>65YO>$10K<$50K',
'GRAND THEFT FIRE EXTINGUISHER',
'LARCENY-OTHER',
'STOLEN PROPERTY',
'BURGLARY - RIOT / SOE',
'BURGLARY A/B - RIOT / SOE',
'FACILITATE BURGLARY',
'OWN AND OPERATE CHOP SHOP',
'GRAND THEFT CARGO O/$50K',
'GT COMMERCIAL SPECIES/ANIMAL',
'THEFT LE EQUIP FROM EMER VEH',
'INT./RECKLESS BURN LAND',
'PAWNING STOLEN PROPERTY',
'STOLEN CARGO LT $50K',
'BURGL-NO FORCED ENTRY-RESIDENC',
'THEFT COPPER/NONFER.METALS',
'PROP. STOLEN;EMRG.MED EQP.',
'THEFT STATE FUNDS $20K-100K',
'VEHICLE THEFT/ILLEGAL USE',
'DAMAGE PROPERTY-OTHER',
'GRAND THEFT OF WILL',
'LARCENY FROM MAILS',
'EXP ELDER',
'POSSESS STOLEN VEHICLE',
'Retail Theft $750(2nd Conv.)',
'STOLEN PROPERTY-OTHER',
'PROPERTY CRIMES',
'THEFT FROM ESTAB.BY EMPLOY',
'OBTAIN GOODS W/O TITLE',
'RETAIL THEFT $300+(2ND CONV.)',
'RETAIL THEFT CONSPIRE',
'BURGLARY SAFE-VAULT',
'OFFERS FOR SALE- >100 & <1000',
'POSSESS MOTOR W/ALT ID NUM.',
'POSSESS STOLEN PROPERTY',
'THEFT OF US GOVT PROPERTY',
'THEFT-STATE FUND $300-20K',
'THEFT/DEST.ARCHEOLOG.SITE',
'BURGL-BANKING-TYPE INST',
'CONCEAL STOLEN PROPERTY',
'ELCTRCL.SUB.STA.METALS,THEFT',
'LARCENY FROM AUTO',
'GT DWELLING',
'LARCENY-PARTS FROM VEHICLE',
'OFFERS FOR SALE-1000 ARTICLES',
'ORG THEFT STOLEN PROP > 3K',
'PROPERTY CRIMES(SP)',
'PURSE SNATCHING-NO FORCE',
'SALE OF STOLEN PROPERTY',
'SEC METAL RECYCLER NOT REG',
'STOLEN VEHICLE - OTHER',
'THEFT-STATE FUNDS $100K+',
'THEFT:CONTROLLED SUBSTANCE',
'BURGLARY ASSAULT ANY PERSON',
'GR. THEFT',
'BURG.-STRUCT DAMAGE',
"RETAIL THEFT",
"THEFT>65YO",
"LAUNDER>100K",
'$LAUNDER>20K<100K',
"FAIL TO RETURN RENTED VEH.",
'FAILED TO RETURN RENT',
"POSSES VEH W/ILL LIC PLATE",
"THEFT STATE FUNDS",
"THEFT-STATE FUNDS"
)
drug_offenses_keywords <- c(
'COCAINE - POSSESSION',
'COCAINE-SALE/MANUF/DELIV.',
'TRAFF.MDMA,PHEN',
'TRAFF.GBL',
'POSS.CONTROL.SUBS/OTHER',
'POSSESS METHAMPHETAMINE',
'MARIJUANA-SALE/MANUF/DEL',
'COCAINE-SALE OR PURCHASE',
'SELL MEDCAD DRUG',
'S/M/D OTH SCH I & II',
'S/M/D METH',
"TAB MACHINE",
'COCAINE-POSSESS',
'SALE COC. ETC. 1K FT.REL/BS',
'POSS.MARIJUANA OVR 20 GRAMS',
'SELL/ETC.COC/HER.1000FT SCH',
'CONSTRUCTIVE POSSESSION',
'TRAFF ILL DRUGS 4-U/14 GRAMS',
'TRAFF COCAINE 28-U/200GR',
'TRAFF AMPH. 14-U/28 GRAMS',
'HEROIN-POSS.LESS/10 GRAMS',
'HEROIN-SALE,MANUF/DELIVER',
'TRAFF AMPH. 28-U/200 GR',
'POSSESS MDMA',
'OTH.DRUG-SALE/MANUF/DELIV',
'TRAFF HER.ETC 28G-U/30 KG',
'TRAFF HER.,ETC.14-U/28 GR',
'TRAFFICK IN FENTANYL 4-13G',
'TRAFF.MDMA,PHEN 10-U/200 GR',
'POSS PLACE TRAFF/MAN SUBST',
'SELL SUBST.INSTEAD DRUGS',
'TRAFF COC 400G-U/150 KG',
'DEAL DRGS-1000',
'CONSPIR.TO TRAFF.DRUGS',
'TRAFF AMPH 200 GR OR MORE',
'POSS/DIST.CHEM.TO MFG.SUB',
'SALE MAR.ETC. 1K FT.REL/BS',
'MARIJUANA-SALE/PURCHASE',
'COCAINE-PUR/POSS W/INT PUR.',
'TRAFFICKING IN COCAINE',
'TRAFF COC 200G-U/400 G',
'S/M/D METH 1K FT REL/BUS',
'SELL/ETC/COC/ETC 1K FT.EDU',
'MARIJUANA-POSSESS',
'S/M/D/ MDMA',
'SELL/ETC/COC/ETC 1K FT.HOUSING',
'TRAFF OXYCODONE 7 - LT 14G',
'HALLUCINOGEN-OTHER-NON MARIJ',
'TRAFFICK IN FENTANYL 14-27G',
'TRAFF CANN 25-U/2000 LBS',
'SELL/PURC.COC/HER/OP.1000FT SC',
'TRAFFICK IN FENTANYL 28+G',
'HEROIN-SALE OR PURCHASE',
'S/M/D MDMA',
'DRUGS SCH 1A,1B,2B',
'AMPHETAMINE-SALE/MAN/DEL',
'SMD METH 1K FT.SCHOOL/PARK',
'THEFT:CONTROLLED SUBSTANCE',
'OWN/RENT STRUC/CONV TRAF/MAN',
'DRUG PARAPHERNALIA-TRANSP',
'MAN/POSSESS IMIT.CON.SUBS.',
'SELL/ETC/COC/HER/1K FT.EDU',
'TRAFF OXYCODONE 14 - LT 25G',
'TRAFF OXYCOD 25 - LT 100G',
'POS/S/M/A/D/UTT PRESCP BLANK',
'POSS.DRUG PARAPHERNA.-MISD',
'SELL/ETC/OTH/DRUG 1KFT.HOUSING',
'OPIUM/DELIV-SALE/MANUF.',
'MARIJUANA-PUR/POSS W/INT PUR',
'DRUG BLDG.-PUBLIC NUISANCE',
'POSSES MARIJUANA-MISD',
'SELL/ETC/OTH/DRUG 1K FT.EDU',
'DANGEROUS DRUGS-OTHER',
'POSSESS BATHSALTS-DRUG',
'S/M/D MDMA 1K FT REL/BUS',
'OTH.DRUG-PUR/POSS W/INT.PURC.',
'TRAFF HYDROCODONE 14 - LT 28G',
'POSSESS CONT.SUB.WO/PRESC.',
'TRAFF.LSD 1- U/5 GR',
'TRAFF.MDMA,PHEN200-U/400 GR',
'POS PLAC MAN SUB/MINOR EXIST',
'COCAINE-SALE/DEL.TO MINOR',
'S/M/D GHB 1K FT REL/BUS',
'SELL/ETC DRUGS 1K FT.EDU',
'POSSESSION DRUG PARAPHERNALIA',
'TRAFF HYDROCODONE 28 - LT 50G',
'HEROIN-POSSESS',
'MARIJUANA-PRODUCING',
'TRAFFICK IN SYN CAN 280-499G',
'1ST DEG MUR,DEATH FRM DRUGS',
'SYN.NARC-SALE/DEL.MINOR',
'TRAFF OXYCOD 100G - LT 30KG',
'SMD GHB 1K FT.SCHOOL/PARK',
'BUY OTH SCH I & II',
'TRAFF.MDMA,PHEN 400+ GR',
'OPIUM-POSS LESS/10 GRAMS',
'HEROIN-SALE/PURCH/DELIV.EXC.10',
'TRAFFICKING IN CANNIBIS',
'AMPHETAMINE-POSSESS',
'AMPHETAMINE-PUR/POSS/W/INT PUR',
'BARBITURATE-POSSESS',
'DEAL/ETC.MAJR.DRG NEAR ALF',
'DEL DRUG TO MINOR 2ND DEG',
'INJECT/INHALE CON.SUBST',
'TRAFF METHAQ 200G-U/5 KG',
'SMD MDMA 1K FT SCHOOL/PARK',
'SMD METH 1K FT.HOUSING',
'SELL/PURC/DEL/DRUGS-1000FT.SCH',
'SMD METH 1K FT.EDU',
'HEROIN-PUR/POSS/W/INT PUR',
'INJECT/INHALE CON.SUBST.',
'MARIJUANA - PRODUCING',
'METH.MANU.W/CHILD U16',
'S/M/D BATHSALTS-DRUG',
'TRAFF HYDROC 200G - LT 30KG',
'SYN.NARCOTIC-SALE/PURCHASE',
'TRAFF IN SYN CAN 1000G-30KG',
'AMPHETAMINE-SALE/PURCHASE',
'BUY METHAMPHETAMINE',
'TRAFF HYDROC 50 - LT 200G',
'TRAFF.1,4 BD 10+ KG',
'TRAFF.1,4-BD 1- U/5 KG',
'TRAFFICK IN CLD $25K+',
'TRAFFICK IN OPIUM,HEROIN,ETC.',
'DEL DRUG TO MINOR 1ST DEG',
'SALE/DEL.O/10GR.HER.SCH.I',
'TRAFF.LSD 7+ GR',
'TRAFFICK IN SYN CAN 500-999G',
'DEAL/ETC.MINR.DRG NEAR ALF',
'MARIJ/LSD-SALE/DEL.TO MINOR',
'BRING INTO STA/COC/HER/OP',
'BUY MDMA',
'DELIVER TO MINOR-METH',
'OPIUM OR DERIVATIVE-POSSESS',
'POSS. O/10GR SCH.IA,IB DRUG',
'SMD BATHSALT-DRUG',
'TRAFF HYDROC 300G - LT 30KG',
'TRAFF.GBL 1- U/5 KG',
'TRAFFICKING IN AMPHETAMINE',
'DRUG DEALI DELIVER TO MINOR-MD',
'HEROIN-SALE/DEL.TO MINOR',
'INTR. DRUG/WEAPN DJJ FACIL',
'METH.MANU.W/CHILD U16 HARMED',
'POSSESS GHB',
'SELL DRUGS W/O PERSCRIPTION',
'SMD MDMA 1K FT.EDU',
'TABLETING MACHINE',
'TRAFF CANN.2000-U/10,000',
'TRAFF HYDROCODONE 100- LT 300G',
'TRAFF HYDROCODONE50 - LT 100G',
'ATMPT.CAP.TRAFF-COC./HER.',
'BARBITUATE-PUR/POSS/W/INT PUR',
'BARBITUATE-SALE/PURCHASE',
'CONTR.SUBST.-2ND VIOL.',
'HALLUCINOGEN-POSSESS-NOT MARIJ',
'OPIUM OR DERIV.-SALE/PURCHASE',
'S/M/D GHB/OTH SCH I & II',
'SALE DRUG PARAPH, 2+',
'SELL MEDCAD DRUG $100K+',
'SMD MDMA 1K FT.SCHOOL/PARK',
'SYNTH NARCOTIC-POSSESS',
'TRAFF COCAINE 150-300K.',
'TRAFF IN SYN CAN 30KG+',
'TRAFF PCP 28-U/200 GRAMS',
'COCAINE-SMUGGLE',
'DANGEROUS DRUGS',
'DEL.DRUG PARA.TO MINOR',
'DELIVER TO MINOR-MDMA',
'DIST.OF NIT.OX.>16GR',
'DISTRI.CONT.SUBS.2ND VIOL.',
'FALSE LABEL-CONTRL.SUBST.',
'HALLUCINOGEN-SELL-NOT MARIJ',
'MANUFAC. POSS W/INTENT TO HARM',
'MARIJUANA-OTHER',
'POSS 10G+ DRUGS SCH 1A,1B,2B',
'SELL/PUR/COC/HER 200FT PUB FAC',
'SMD BATHSALT 1K',
'SMD GHB 1K FT.EDU',
'SMD GHB 1K FT.HOUSING',
'TRAFF GHB >1KG<5KG',
'TRAFF PCP 200-U/400 GRAMS',
'TRAFF ROHYPNL 4-LT 14GR.',
'TRAFFIC BATHSALTS-DRUG>10KG',
'TRAFFICKING IN METHAQUALONE',
'AMPHETAMINE-MFT',
'BRING GHB INTO STATE',
'BRING METH INTO STATE',
'DELIVER TO MINOR-BATHSALTS',
'DISTRI.CONT.SUBS. 2ND VIOL.',
'DRUG VIO.INJ.SP.GOV.EMP.',
'DRUGS-OTHER',
'EMP NEG JUV OFF, NO GHB ETC',
'HEROIN-SMUGGLE',
'MARIJUANA-SMUGGLE',
'OPIUM OR DERIVATIVE-OTHER',
"POSSESS 'ADULTERATED DRUG'",
'TRAFF.LSD',
'POSSESS ROHYPNL OVR 10GR',
'S/M/D GHB',
"SELL MEDCAD DRUG",
'SELL CONT.SUBS. 2ND VIOL.',
'SELL EPHEDRINE/ETC.3RD OFF.',
'SELL MEDCAD DRUG < $20K',
'SELL/DEL. ROHYPNL OVR 10GR.',
'SMD BATHSALT-DRUG 1K',
'SMD FENTANYL OR ANALOGS',
'TRAFF.1,4 BD 10',
'SMD MDMA 1K FT.HOUSING',
'TRAFFICK IN CLD',
'TRAFF BATHSALTS-DRUG>1KG<5KG',
'TRAFF CANN 10000 LBS/MORE',
'TRAFF GHB >5KG<10KG',
'TRAFF HER,ETC 30-LT 60K.',
'TRAFF ROHYPNL 28-LT 30K.',
'TRAFF.1,4 BD 5- U/10 KG',
'TRAFF.GBL 10+ KG',
'TRAFF.GBL 5-U/10 KG',
'TRAFF.LSD 5 -U/7 GR'
)
violent_crimes_keywords <- c(
'ROBB. GUN OR DEADLY WPN',
'ROBB. NO GUN/DDLY.WPN',
"BATT. ON OFFICIAL/EMPLOYEE",
'SER.INJ/FRM 782.04(3)OFF.',
"BATT.LEO/FIRFGT/EMS/ETC.",
"RESISTING OFFICER W/VIOLEN.",
"MANSL. OF LEO/EMT/FIREFTR",
"BATT. RYCE FACILITY STAFF",
"AGG.ASSLT.ON OFFICIAL/EMPLOYEE",
"SEXUAL BATTERY BY LEO",
'AT.FLNY.MURD',
'SER.INJ/FRM 782.04(3)OFF',
'SEX BATT',
"RIOT-INCITING",
"AGG.ASSLT/LEO/FIREFGT/EMS/ETC.",
"AGG.BATT/LEO/FIRFGT/EMS/ETC.",
"BATTERY ON DETENT.FAC.STAFF",
"AGG.BATT.BY DETAINEE",
"BATTERY BY DETAINEE",
"ASSAULT BY INM W/N CO FACILITY",
'AGG ASSLT-W/WPN NO INTENT TO K',
'1ST DG MUR/PREMED. OR ATT.',
'2ND DEG.MURD,DANGEROUS ACT',
'AGG BATTERY/W/DEADLY WEAPON',
'BURGLARY ASSAULT ANY PERSON',
'KIDNAP;COMM.OR FAC.FELONY',
'FELONY MURDER-NONSEX',
'FALS.IMPRSN-NO 787.01 INT',
'a-s, murder',
"1ST DEG MUR,DEATH FRM DRUGS",
'ROBB. WPN-NOT DEADLY',
'AGG BATTERY INTENDED HARM',
'2+ SIMPLE BATTERY',
'HOME INVASION/COM.FELONY',
'FELONY BATTERY',
'HOMICIDE,MANSL.CUL.NEGLI',
'CARJACK W/FA,DEADLY WEAPON',
'DOMESTIC BATT STRANGLE',
'1ST DEG MUR,COM.OF FELONY',
'SUDDEN SNATCH NO WEAPON',
'CARJACK W/O FA/DEAD WEAP',
'KIDNAP,ASSAULT OR TERRORIZE',
'HOME-INVAS.ROBB.FA/DLY.WPN',
'AGGRAV.BATTERY,VICTIM PREGNANT',
'AGG ASSLT-INTENT COMMIT FELONY',
'BATTERY UPON PERSON 65/OLDER',
'ARSON WILLFUL DAMA.DWELLING',
'ARSON,WILLFUL DAMA.STRUCT.',
'AT.FLNY.MURD/782.04(3) OFF.',
'SECOND DEG.MURDER,COMM.OF FELO',
'DISCHARGE F/A FR.VEHICLE W/I 1',
'HOMICIDE NEGLIG MANSL VEH',
'HOME INVASION - ROBBERY',
'HOME-INVASION ROBBERY',
'AGG. BATTERY/65 YRS OR OLDER',
'KIDNAP;HOLD RANSOM OR HOST.',
'a-s, murder o/t 782.04(4) a-s',
'ROBBERY',
'SEX BATT',
'AT.FLNY.MURD',
'VEHICLE HOMCID-NO AID/INFO',
'AGG.MANSL.-CHILD',
'HOME-INVAS.ROBB.OTHER WPN',
'FALSE IMPRISON MINOR AGA.WILL',
'BATT ON CHILD-BODY FLUIDS',
'AT.FLNY.MURD/NOT 782.04(3)',
'KIDNAP V<13/AGG.CHLD ABUSE',
'3+ BATTERY',
'AGGRAVATED BATTERY',
'SUDDEN SNATCH F/A OR DW',
'ROBBERY-BUSINESS-GUN',
'AGG.ASSAULT/65 YRS./OLDER',
'ATTEMPT MURDER LAW ENFORCE OFF',
'ASSAULT-OTHER',
'ROBBERY-OTHER/OTHER STATE',
'DOM VIO INJUC VIO 2+ PRI CON',
'SIMPLEBATTERY-MISD',
'KIDNAP MINOR AGAINST WILL',
'ARSON,DEFACES CHURCH',
'BOD.INJ./NOT 782.04(3)OFF.',
'AGG.MANSL.-ELDER/DISABLD',
'AGGRAV. ASSAULT/BATTERY',
'ARSON,CRIMINAL MISCHIEF',
'HOMICIDE-NEGLIG MANSL-VEH',
'STALK VIO INJ VIO 2+ PRI CON',
'HUMAN SMUGGLING',
'ARSON,WILLFUL INJ.TO PSN.',
'HOMICIDE,KILL UNBORN CHLD',
'ROBBERY-STREET-GUN',
'1ST DG.MURDER/UNBORN CHILD',
'SER.INJ/FRM 782.04(3)OFF.',
'3+ BATTERY',
'HARMS PUBLIC SERVANT',
'HOMICIDE-OTHER/OTHER STATE',
'ROBBERY-STREET-STRONGARM',
'AGGRAV ASSLT-NONFAMILY-GUN',
'AGGRAV ASSLT-NONFAMILY-OTHER',
'ASSAULT-MISD',
'HOMICIDE-WLFL KILL-NONFMLY-GUN',
'HOMICIDE,MANSL.UNNC.KILL',
'KIDNAP,INTERF W/PERF GOVERN',
'ROBBERY-STREET-OTHER WEAPON',
'AGGRAV ASSLT - OTHER WEAPON',
'HOMICIDE-WILFUL W/VESSEL',
'KIDNAP MINOR FOR RANSOM',
'AGG.ASSAULT CODE INSPECTOR',
'ROBBERY-RESIDENCE-GUN',
'VESSEL HOMCID-NO AID/INFO',
'AGGRAV ASSLT-NONFAMILY-STGARM',
'AGGRAV ASSLT-POL OFF-STGARM',
'AGGRAVATED ASSAULT - GUN',
'ARSON',
'ARSON-OTHER/OTHER STATE',
'FORCIBLE PURSE SNATCHING',
'HOMICIDE',
'HUMAN TRAFFIC - VIOLENT',
'MANSLAUGHTER/UNBORN CHILD',
'2ND DG.MURDER/UNBORN CHILD',
'ARSON,DAMAGE ART WORK',
'BRAND CHILD - TRAFFICKING',
'HOMICIDE-WILLFUL KILL-GUN',
'KIDNAP-OTHER',
'ROBBERY-BUSINESS-OTHER WEAPON',
'ROBBERY-BUSINESS-STRONGARM',
'1st DEG MUR/V - LEO',
'ROBBERY-RESIDENCE-STRONGARM',
'AGGRAV ASSLT-POLICE OFF-OTHER',
'AGGRAV ASSLT-PUB OFF-OTHER',
'AGGRAV ASSLT-PUB OFF-STGARM',
"AGG.ASSLT.BY DETAINEE",
'ARSON-RESIDENCE',
"USE SELF-DEF. WEAPN ON LEO",
'ARSON,BURNING WOODS',
'BATTERY CODE INPECTOR',
"ASSAULT BY PRISONER",
'HOMICIDE-WILLFUL KILL-FMLY-GUN',
'HOMICIDE,MANSL.ASST.SELF-MUR',
'ILLEGAL OBT.LABOR W/FORCE',
'JUV. BATT. HEALTH SERV.PER.',
'SIMPLE ASSAULT',
'SEX BAT/ WPN. OR FORCE',
'L/L BATT.SEX W/V12-15',
'SEX BAT/INJURY NOT LIKELY',
'L&L BATT MINOR',
'SEX BAT/COERCES BY THREAT',
'L/L BATTERY V 12-15 YO',
'SEX BATT V & O 18+, NO INJURY',
'SEX BAT BY JUVEN/VCTM UNDER 12',
'LEWD ASLT/SEX BAT VCTM<16',
'SEX BATT V12-17, NO INJURY',
'SEX BATT V & O 18+',
"SEXUAL BATTERY UNSPECIFIED",
'SEX BAT/PHYS HELPLESS RESIST',
"SEX BATT V12-17 O18+",
"L/L BATT.CAUSE SXACT V<16",
"SEX BAT/MENTALLY DEFECTIVE",
"L&L BATT",
"SEX BATT V <12 FAM LIFE",
"EX BATT V <12 FAM CAP",
"RAPE - STRONGARM",
"SEX BAT/COERCES BY RETALIATION",
"SEX BATT/CARNAL INTERC. U/18",
"SEX BATT/SOLICITATION OF CHILD",
"KIDNAP V<13/SEX. BATTERY",
"LEWD BATT.ON ELDER/DISABLD",
'SEX.BAT/VICT O/12 INCAP',
'SEX ASSLT-OTHER/OTHER STATE',
'FALS.IMP.V<13/SEX. BATTERY',
'SEX BAT/VICTIM DRUGGED',
"RAPE - GUN",
"RAPE WITH OTHER WEAPON",
"SEX ASSAULT/BATTERY",
"FALS.IMP.V<13/L&L FS800.04",
"SEX ASSLT - CARNAL ABUSE",
"BATTERY OF HRS EMPLOYEE",
"AGG.BATT.ON OFFICIAL/EMPLOYEE",
"AGG.BATT. RYCE FAC. STAFF",
'SIMPLE BATTERY',
'3+ BATTERY')
sex_crimes_keywords <- c(
'POSS PHOTO ETC CHILD SEX PERF',
'SEX BAT BY ADULT/VCTM LT 12',
'L/L MOLEST V<12 OFF 18+',
'SEX BAT/MINOR,FAM/CUST AUTH',
"SEXUAL BATTERY BY LEO",
'SEX BAT/ WPN. OR FORCE',
'IMPREG.GRL LT 16',
'L/L MOLEST V12-15 OFF 18+',
'L/L, INDEC.ASLT CHILD U/16',
'L/L BATT.SEX W/V12-15',
'SEX BAT/INJURY NOT LIKELY',
'L&L BATT MINOR',
'EXP OF SEX ORGANS 2ND+ VIOL',
'USE OF CHILD, PROM.SEX PERFM',
'L/L CONDUCT V<16 OFF 18+',
'ADLT SEX W/16-17 YR OLD',
'L/L EXHIBIT. V<16 OFF 18+',
'SEX ACT COERCE CHILD BY ADULT',
'SEX BAT/COERCES BY THREAT',
'SEX BATT',
'SEND CHILD PORN.',
'USE OF CHILD, ENG SEX PERFM',
'TRVL MET MINOR INTERNET SO,L&L',
'USE OF CHILD, SEX PHOTO ETC',
'L/L BATTERY V 12-15 YO',
'SEX BATT V & O 18+, NO INJURY',
'SEX BAT BY JUVEN/VCTM UNDER 12',
'INTERNET/LURE CHILD FOR SEX',
'SEX BATT',
'LEWD ASLT/SEX BAT VCTM<16',
'PROV.OBSCENE MAT.MINOR',
'SEX BATT V12-17, NO INJURY',
'VIDEO VOYEURISM',
'SEX BATT V & O 18+',
'L/L MOLEST V<12 OFF<18',
'SEXUAL BATTERY UNSPECIFIED',
'L/L EXHBT - PRESNCE OF EMPLYEE',
'MAN 21+ IMPREG.GRL LT 16',
'SEX BAT/PHYS HELPLESS RESIST',
'USE COMPUTR SEX W/MINOR',
'INCEST WITH RELATIVE',
'SEX BATT V12-17 O18+',
'L/L BATT.CAUSE SXACT V<16',
'COMM SEX MINOR/MENT INCAP',
'L/L MOLEST V12-15 OFF<18',
'USE/PROD - MINOR SX MATERIAL',
'VID VOYEUR-CHLD<16',
'PROFIT FROM PROST 1ST OFF',
'SEX BAT/MENTALLY DEFECTIVE',
'L&L BATT',
'SEX BATT V <12 FAM LIFE',
'WWW/ASK PARENT:SEX W/MINOR',
'SEX BATT V <12 FAM CAP',
'HUM TFK:SEXUAL ADULT',
'FEL. PROSTITUTION 3rd CONV.',
'L/L COMP. EXHIB. OFF 18+',
'SEX BATT V12+ O<18, NO INJURY',
'SEND CHILD PORN-OTH STATE',
'RAPE - STRONGARM',
'SEX BAT/COERCES BY RETALIATION',
'SEX BATT/CARNAL INTERC. U/18',
'ADLT/CUST VID VOYEUR-CHLD<16',
'PROCURE FOR PROSTITUTE(PIMPNG)',
'LEWD MOLEST.-ELDER/DISABLD',
'L/L EXHIBIT. V<16 OFF<18',
'SEX BATT/SOLICITATION OF CHILD',
'L/L CONDUCT V<16 OFF<18',
'EXP OF SEX ORGANS 2ND+ VIOL',
'KIDNAP V<13/SEX. BATTERY',
'HUMAN TRAFFICKING:SEX TRADE',
'SEX BATT V 12+ O<18',
'HARAS WITNES PBL/LF/CAP CASE',
'HUMAN TRFC:SX TRADE,CHILD<18',
'LEWD BATT.ON ELDER/DISABLD',
'SEX VIO INJUC VIO 2+ PRI CON',
'SEX.BAT/VICT O/12 INCAP',
'HUM TFK:LABOR SERV ADULT',
'SEX ASSLT-OTHER/OTHER STATE',
'FALS.IMP.V<13/SEX. BATTERY',
'FEL PROSTITUTION ETC 3RD CONV',
'HUM TFK:LABOR SERV MINOR',
'HIV-POS.HAS SEX 2+ VIOLATIONS',
'SEX MISC.PSYCHOTHERAPIST',
'SEX BAT/VICTIM DRUGGED',
'KIDNAP V<13/L&L FS800.04',
'HUMAN TRFC:SX TRADE,INTRSTATE',
'L&L BATT O18+ 2ND+ VIO',
'SEX OFFENSE-OTHER',
'SEX TRAFFICKING',
'APD STAFF SEX W/DISABLED PER',
'RAPE - GUN',
'RAPE WITH OTHER WEAPON',
'SEX ACT/SOLICIT OF CHILD',
'SEX ASSAULT/BATTERY',
'SEX BATT V12+, PRIOR CONV',
'FALS.IMP.V<13/L&L FS800.04',
'Sex Contact w Animals',
'ADLT/CUST VID VOYUER-CHLD<16',
'HUMAN TRFC:SX TRADE,CHILD<15',
'LEWD EXHIBIT-ELDER/DISABLD',
'LURE CHILD INTO BLDG/CAR',
'CRIM.SOLIT.CHILD UNDER 12',
'FORCE TO BECOME PROSTITUTE',
'FORCED PROSTITUTION',
'HT:SEX TRANSF STATE MINOR',
'IND L&L Touch o 24+v 16/17',
'INDECENT EXPOSURE',
'INDECENT EXPOSURE-MISD',
'L&L',
'SEX ASSLT - CARNAL ABUSE',
'SEX BATT',
'VID VOYEUR - STUDENT',
'HUM TFK:COMM SEX ADULT ALIEN',
'LURE CHILD PREVIOUS LURE',
'PROFIT FROM PROST 3RD OFF',
'SEX ASSLT-SODOMY-BOY-STGARM',
'SEX ASSLT-SODOMY-MAN-OTHER',
'SEX ASSLT-SODOMY-WOMAN-STGARM',
'MAN 21+ IMPREG.GRL LT 16'
)
incarceration_related_crimes <- c(
'BATT.LEO/FIRFGT/EMS/ETC.',
'RESISTING OFFICER W/VIOLEN.',
'ESCAPE',
'SX OFFNDR FAIL COMPLY PSIA',
'FLEE/ELUDE LEO-FELONY',
'2-WAY COMM.-COMMIT FELONY',
'EMPLOYEE SEX W/DJJ OFFNDR',
'AGG.ASSLT/LEO/FIREFGT/EMS/ETC.',
'BATTERY BY DETAINEE',
'CO DET FAC',
'STAFF SEX W/APD CLIENT',
'STAFF SEX W/INMATE/OFENDER',
'MISD. TO FEL.BY GANG MEMBR',
'CONTRABAND, CO DETENTN FAC',
'POSS.FIREARM BY FELON',
'INJ/KILL PD/FD/SAR ANIMAL',
'FAIL.TO APPEAR/FEL.BAIL',
'AGG.BATT/LEO/FIRFGT/EMS/ETC.',
'SEX OFF/PRDR POSS ALT DL/ID',
'AGG.FLEE/ELUDE LEO',
'FLEE LEO/NO REGARD',
'BRING INTO STA/COC/HER/OP',
'FLEE LEO/HISPEED,NO REGARD',
'HABITUAL TRAFFIC OFFENDER',
'DRUG\\ESCP\\CP CB, CO DET FAC',
'ATT.ELUDE LEO',
'BATTERY ON DETENT.FAC.STAFF',
'FAIL REGISTER-CAREER CRIM.',
'TAMP. WITH ELEC. MON. DEVICE',
'INTRODUCE CONT.SUBSTANCE',
'SEX OFF, TRANS NO REP',
'FAILURE TO APPEAR',
'CONSTRUC.POSSESS CONTRAB.',
'SX.OFNDR.RE-REGISTR.VIOL.',
'VLNT.CAREER CRIM.POSS.GUN',
'FLUIDS AT CORRECTION STAFF',
'AGG.BATT.BY DETAINEE',
'WPN CONTRA, CO DETENTN FAC',
'SEX PRED FAIL TO REGISTER',
'SX.OFNDR.NOT NOTIF.SHERIFF',
'TRANSMIT CONTRABAND-PRISON',
'POSS CELL PHONE IN PRISON',
'SEX PRED, TRANS RES NO REP',
'DAMAGE ELEC.MONITOR.EQUIP.',
'SX OFFNDR FAIL RPT.NONMOVE',
'AGGRAVATED FLEEING LEO',
'RESIST.LEO/NO VIOL.-MISD.',
'INTRODUCE WEAPON/FIREARM',
'ASSAULT BY INM W/N CO FACILITY',
'BATT. ON OFFICIAL/EMPLOYEE',
'ESCAPE JUV. DETENTION FACILITY',
'RIOT-INCITING',
'PRISONER POSSESSING WEAPON',
'ESCAPE FROM JUVENILE FACILITY',
'INTRODUCING CURRENCY',
'AGG.FLEE/ELUDE LEO SBI/DTH',
'SEX PRED.FAIL RPT.NONMOVE',
'MANSL. OF LEO/EMT/FIREFTR',
'AIDS ESCAPE',
'AGG.FLEE LEO INJ./DAMAGE',
'MISC VIOLATIONS',
'CONTINUING CRIMINAL ENTER',
'BATT. RYCE FACILITY STAFF',
'DIRECTS GANG ACTIVITIES',
'FLEE/ELUDE',
'FAIL.TO APPEAR/PRIN.CHRG',
'PRISONERS RIOT,STRIKE,MUTINY',
'SX.PRED.NOT NOTIF.SHERIFF',
'BRING INTO STA/CONTR SUBST',
'AGG.ASSLT.ON OFFICIAL/EMPLOYEE',
'LIE TO LEO-CAP.CASE',
'TAKES LEO FIREARM',
'SEXUAL BATTERY BY LEO',
'FLEE/ELUDE LEO W/BOAT',
'PREVIOUS CONVICT SUBSECT. 1,2',
'SOLICIT GANG MEMBERSHIP',
'AGG.ASSLT.BY DETAINEE',
'CARRIES TOOLS AID ESCAPE',
'INTRO.INTOXICATING BEV.',
'USE SELF-DEF. WEAPN ON LEO',
'ASSAULT BY PRISONER',
'DEFACE RYCE DET. FACILITY',
'ESCAPE-TREATMENT PROGRAM',
'FALS.ACCUSE LEO SEXUAL BATT.',
'HARBOR,CONCEAL,AID ESCAPEE',
'PAROLE VIOLATION',
'RIOT,DESTROY PROPERTY',
'THEFT SEMI DEPLOY. BY LEO',
'WIRETAP-FAILURE TO REPORT',
'874.04 FAIL TO REGISTER',
'BATTERY OF HRS EMPLOYEE',
'ESCAPE/UNLAW.FLIGHT',
'SUPERVISION VIOLATION',
'UNAUTH. COMP. ACCESS',
'1ST DEG ATT MUR/V - LEO',
'AGG.BATT. RYCE FAC. STAFF',
'AGG.BATT.ON OFFICIAL/EMPLOYEE',
'BENEFIT GANG VIA ELEC COMM',
'CONTRA JUV FACILITY',
'EXCON ENGAGE IN BAIL BOND',
'HARBR/HIDE/LIE RE SX.OFNDR.',
'BRING CONTR.SUB.INTO STATE',
'CONDIT RELEASE VIOLATION',
'DEL.FA PERSON PROHIB.POSS.',
'FLEE/ELUDE LEO-MISD.',
'FLIGHT-ESCAPE-OTHER',
'GRAND THEFT - RIOT / SOE',
'OFFENDER REFUSE PHOTO',
'PRISONERS TAKING HOSTAGES',
'RIOT - INCITING',
'STOLEN PROP - RIOT / SOE'
)
white_collar_fraud_crimes <- c(
'UTTER FORGED INSTRUMENT',
'FALS INF. TO PWNBRKR<$300',
'FORGERY/UTTERING',
'FRAUD USE OF PERSONAL ID',
'FRAUD-CREDIT-CARD',
'UTTERING FORGED BILLS',
'ENG. INS. ACT. NO LICENSE',
'UTTERING FORGERY',
'EXPL ELDER',
'LAUNDER',
'TRANS>100K',
'FALSE INFORM.ON APPLICA.',
'TRANS>300<20K',
'TRANSMITTER >',
'THEFT-STATE FUND',
'FALSE INFO SEC MET RECYCL',
'FALS INF. TO PWNBRKR > $300',
'ORG.FRAUD - UNDER $20,000',
'FORGE LABELS',
'MEDICAID PRVDR FRD',
'ILL.POSS.CREDIT/DEBIT CARD',
'DEP.CHECK W/INT DEFRAUD',
'UNAUTH POSS/USE OF DL/ID',
'MISUSE CONFID.OR FALSE INFO',
'MEDICAID PRVDR FRD',
'OBT.SUB BY FRAUD OR ATT.',
'FRAUD-CHECK',
'COMMERCIAL FRAUD < $300',
'PRAC.HLTHCARE',
'PRAC.HEALTH CARE',
'CONS.TO VIO.RACKTEERING LAW',
'RACKETEERING',
'UNAUTHORIZED LAW PRACTICE',
'SALE OF COUNTERFEIT DRUGS',
'ACQUIRE PROP. F/RACKETEERING',
'WORTHLESS CHECKS',
'COMMIT 815.06(3)(B)',
'COUNTERFEIT PAYMENT INSTR.',
'ORG.FRAUD-$50K OR MORE',
'FRAUD USE ID $5K+/10+ PERSONS',
'DEFRAUDING FINANCIAL BUSINESS',
'FRAUD-RENTAL PROPERTY $300',
'ILL.POSS.CREDIT CARD &PURC.OVE',
'PATIENT BROKERING',
'FRAUD USE ID V.<18&>60',
'EXTORTION',
'SALE COUNTERFEIT CONT.SUB',
'$LAUNDER>100K',
'ORG.FRAUD-$20K BUT < $50K',
'SELL UNNUMBERED AUTO',
'POSS PRSNL ID INF 5+ PERSONS',
'COMMERCIAL FRAUD > $300',
'FRAUD USE ID $50K+/20+ PERSONS',
'FALSE STATMT INSURANCE CO.',
'$LAUNDER>20K<100K',
'EXPL ELDER/DISABLD LT$20K',
'POSS.10/MORE FORGED NOTES',
'GROSS FRAUD OR CHEAT',
'CONTRACT FRAUD,EMERG/2ND CON',
'BRIBERY',
'CRM. W/FAKE LEGAL PROCESS',
'FRAUD-BY WIRE',
'POSS.FORGED/STOLEN LICENSE',
'INS. CLAIM FRAUD $20K < $100K',
'ALTER ID ON FIREARM',
'EXP ELDER DISABLD LT10K',
'CNTRFIT/FICT.PERS.ID FRAUD',
'CREDIT CARD FRAUD O/300',
'FRAUD-OBTAIN $$$/FALSE STATEME',
'FRAUD-TO INCREASE BENEFITS',
'INSURANCE FRAUD',
'CONSPIRE TO RACKETEER',
'OBTAIN CNTRLLD.SUBS.BY FRAUD',
'UNLAWFUL COMPENSATION',
'FAM.SERV.FRAUD $200 OR MORE',
'$LAUNDER>$300<$20K',
'COUNTERFEITING',
'FALSE APPL. VIN-TITLE-ETC',
'ORGNIZD COMNICATNS FRAUD',
'USE FALSE NAME IN APPLICATION',
'PURCH.W/FALSE CREDIT CARD',
'DRUG ABUSE-FRAUD MATERIAL',
'ID FRAUD-DEAD PERSON',
'TRANSPORT FORGED BILLS',
'FALSE APPL./STATE. RE:DL',
'OBTAIN SUBSTANCE BY FRAUD',
'PRAC. NATURO W/O LIC',
'FALSE CERTIFICATE NOMINATION',
'FILE FALSE DOC PUB OFF',
'EXP ELDER DISABLD $50+',
'OBTAIN LODGING W/INTENT FRAUD',
'FRAUD. USE OF SCANNER',
'TRAFF CRED CARDS 5-14',
'DEAL STOLEN PROP-INTERNET',
'EXP ELDER DISABLD $10-LT50K',
'MAKES,ALTERS,FORGES LOTTERY TI',
'MAKING FALSE REPORT',
'COUNTERFEIT LICENSE PLATE',
'UTTERING UNCURRENT BILLS',
'FALS INF. TO PWNBRKR',
'EXPL ELDER/DISBLD $20-100K',
'FORGE AUTO TITLE',
'FRAUD CONST.FUND O/20,000',
'FRAUD CREDIT UNIONS-BANKS',
'HUMAN TRAFFICK-FINANCIAL',
'LOTTERY-OPERATING',
'PUB ASST FRAUD $200<$20K',
'RENT VEH.W/INTENT DEFRAUD',
'ARSON, PROPERTY DEFRAUD',
'DISCLOSE/OBTAIN CRASH INFO',
'FORGERY OF CHECKS',
'FRAUD-OTHER',
'FALSE INFO TO SEC MET RECYCL',
'TRAFF CRED CARDS 15-49',
'UTTER FORGED BILLS 2ND CONV',
'FILING FALSE DOCUMENTS',
'INS. CLAIM FRAUD $100K+',
'USE FORGED AUTO TITLE',
'CREATE FALSE INS. ID',
'EXPL ELDER/DISABLD $100K+',
'TAX EVASION',
'COUNTERFEIT CREDIT CARDS',
'FALSE PERSONATION (FRAUD)',
'INS.CLAIM FRAUD < $20K',
'FRAUD GET FUEL/ILGL.TRNSPRT',
'PRESENTS CONTERFEIT LOTTERY TI',
'SUPPLY STOLEN/FAKE ID/LIC.',
'WRKR CMP FRAUD LT $20K',
'BURGL AUTHORIZED EMER VEHICLE',
'FRAUD-COVER-UP/CONCEAL,ETC',
'PHYSICIAN/INSURANCE FRAUD',
'STAGE CRASH FOR INS. CLAIM',
'AGG. WHITE COLLAR CRIME',
'FRAUD-FALSE STATEMENT',
'FRAUD-SECURITIES',
'BUY,SELL VESSEL W/ALT.NUM.',
'FRAUD USE ID VCTM. <18YO',
'FRAUD. USE OF ID LT $75 K',
'FRAUD/FORGE ATV REG.DOCS.',
'ID FRAUD-DEAD $5K/10-19 VIC.',
'MEDICAID REIMBURSE.FRAUD',
'MISREPRESENTATION',
'POSS.COUNTERFEIT TOOLS',
'POSS/SELL/DEL SKIMMING DEV',
'ANTITRUST',
'FALSE DOC/OWN FIN LOSS',
'FALSE REPORTS OF DEADLY EXPLOS',
'MAKE FALSE REPORT',
'REC.MONEY THRU FRAD.USE CREDIT',
'S/M/D STOLEN ETC.DL/IDFACT',
'SELL/EXCHG ILLEGAL LIC PLATE',
'WILLFUL SUBMIT FALSE AFF.',
'RECEIV. PROCEEDS F/RACKETEERIN',
'TRAFF CRED CARDS 50+',
'FALS.IMP.V<13/EXPL.FS450.151',
'FORGERY',
'FRAUD - IMPERSON',
'FRAUD/OBTAIN MORTGAGE',
'ORG.FRAUD-$50,000 AND OVER',
"COMMIT 815.06(3)(A)",
'PATIENT BROKERING 20+',
'WRKR CMP FRAUD $100K-UP',
'CREDIT CARD THEFT-MISD.',
"FRAD'LY OBTAIN PROP,ETC.",
'FRAUD',
'OCCUPATION LICENSE FRAUD',
'PASS TITLE ON STOLEN VEHICLE',
'PATIENT BROKERING LT10',
'STRUCT $ TRANS>20K<100K',
'$ TRANSMITTER >$100K',
'BRIBES RECEIVING COMPENS.',
'DEAL.INS.NO CERTIF/AUTH.',
'DERELICT MV CERTIFICAT FRAUD',
'EXPLOSIVES-TEACHING USE',
'FILE FALSE DOCNUMENTS 2+',
'FILLING PERSCRIPTIONS',
'FRAUD CONSTRUCT.FUNDS',
'FRAUD INVOL.SECUR. O/$300',
'FRAUD MARKET PRAC.',
'FRAUD-CERTIFICATES',
'FRAUD-CLAIMS COMPENSATION',
'ID FRAUD-DEAD $50K/20+ VIC.',
'INSUR.AGNT EMBEZ.O/20,000',
'MAIL FRAUD',
'MEDICAID PROVIDER FRAUD',
'MEDICAID PRVDR FRD>$10K<$50K',
'PRACTICE MEDICINE W/O LICENSE',
'PRSCRBR SCRIPT.FRAUD $1K+',
'STRUCT $ TRANS>100K',
'STRUCT $ TRANS>300<20K',
'TELEPHONE SALES/FALSE APP.',
'$ TRANSMITTER >$20K<$100K',
'AGENT/ISSUE LICENSE REQUIREMEN',
'BRIBES IN ATHLETIC CONTEST',
'CHECKS AND DRAFTS VIOLATIONS',
'COMP OFF TO DEFRAUD/OBT PROP',
'DEFRAUD MEDCAD <$20K',
'DEFRAUD MEDCAD $100K+',
'DENY COMPUTER SERV W/INT DEF',
'EMBEZZLE-BANKING-TYPE INST',
'EMBEZZLE-BUSINESS PROP',
'EMP - CONSTR.POSSESS CB',
'EXPLOIT AGED PERSON/MISMANGMT.',
'EXPLOT.OF AGED PERSON,CAUSE BO',
'FAIL RE ESCROW/TRUST REQ.',
'FALS.MV INS. APPLICATION',
'FORGE LABELS >$20K',
'FORGE LABELS >$2500 <$20K',
'FORGERY/POSSESSION OF TOOLS',
'FORGERY/UTTERING(SP)',
'FRAUD BY MISREP CHARITY',
'FRAUD USE ID MINR CHLD/WARD',
'FRAUD-BUSINESS OPERATION',
'FRAUD-CREDIT CARDS',
'FRAUD-TO REDUCE LAWFUL PAYMENT',
'INSUR.AGNT.EMBEZO/100,000',
'MEDICAID PRVDR FRD $50K OR >',
'MISAPPRO.FUNDS TIME SHARE PL',
'OBTAIN LICENSE FRAUDULENT',
'ODOMETER TAMPERING',
'ORGAN.FRAUD O/50,000',
'PRESENTS FALSE STATEMENT CLAIM',
'PROCURE TITLE ON STLN VESSEL',
'PRODUCT/LABEL TAMPERING',
'PUB ASST FRAUD $20K < $100K',
'SELL/GIVE CLD TO UNAUTH.PERSON',
'USE FORGED TITLE ON VESSEL',
'UTTER FORGED BILL,2ND CONV',
'WRKR CMP FRAUD $20K-U$100K',
'POSSESS MOTOR W/ALT ID NUM.',
'FAIL TO REGISTER SECURITIES',
"PRACTICE DENTISTRY",
"TRANS>20K<100K",
"TRANSMITTER"
)
traffic_crimes <- c(
'DRIV W/LIC S/R/C/D FELONY',
'DUI MANSLAUGHTER',
'FELONY DWLSR',
'DUI,CAUSE SERIOUS BODILY INJRY',
'LEAVE CRASH W/DEATH',
'LEAVE CRASH W/INJURY',
'FELONY DUI 4TH/SUBS.CONV.',
'BOATING (BUI)-4TH OR SUBS.',
'LVE CRASH OTHR THAN SER INJ',
'DRIV.W/O LIC.INJ/DEATH',
"DL.VIOL.(NOT DWLSR)-MISD.",
'DRV W/LIC PERM REVOKED',
'FELONY DUI 3RD CONV.',
'LEAVE CRASH W/SERIOUS INJ',
'RECKLESS DRIVE-BODILY INJ.',
'HIT AND RUN',
'DUI. MANS.-NO AID OR INFO',
'FAIL STOP CRASH INJ/DEATH',
'DRIVE W/LIC. S/R/C/D-MISD.',
'DUI,MANSLAUGHTER',
'DWLSR',
'DUI-MISD.',
'TRAFFIC OFFENSE-OTHER',
'BUI MANSLAUGHTER',
'BUI W/SERIOUS BODILY INJ.',
'DL.VIOL.(NOT DWLSR)-MISD.',
'LEAVE ACCIDENT SCENE-MISD.',
'RECKLESS DRIVING-MISD',
'UNAUTH USE OF VEH(INC JOY-RID)',
'BOATING (BUI)-4TH OR SUBS.',
'CDL C/S/R/D 2nd+',
'TRAFFIC OFFENSE',
'BUI MANSL.-NO AID/INFO.',
'DUI',
'FELONY BUI 3RD CONV.',
'IMPROPER TAG-MISD.',
'LEAVE VESSEL ACDT W/INJURY',
'TOW/STORE VEH.VIOL.'
)
abuse_neglect_crimes <- c(
'AGGRAVATED CHILD ABUSE',
'WILLFUL CHILD ABUSE',
'CHILD NEGLECT',
'ABUSE CHILD',
'NEGLECT CHILD',
'CHILD NEGLCT-GRT.BODILY HARM',
'CHILD ABUSE-INJ/NEGLECT',
'ABUSE CHILD-INJURY',
'NEGLCT CHILD W/GR.BOD.HARM',
'ABUSE ELDER/DISABLD',
'CHILD ABUSE-NEGLECT',
'AGG.ABUSE - ELDER/DISABLD',
'ABUSE ELDER/DISABLD-INJURY',
'FALS.IMP. V<13/AGG.CHLD ABUSE',
'NEGLCT ELDER/DISABLD',
'FAIL RPRT NEGL.ABUSE CHILD',
'FAIL TO REPORT CHILD ABUSE',
'NEGLCT ELDER/DISABLD-HARM',
'DEPRIVE VIC MED/COND WORSENS',
'ABUSE ELDER/DISBLD-HARM',
'FALSIFY CARE RCRD-BOD.HARM',
'FAMILY OFFENSE-OTHER',
'LEAVE CHILD IN CAR/GBH',
'PARENT/GUARDIAN SELLS CHILD'
)
category_mapping <- list(
"Burglary, Theft, Property Crimes" = burglary_theft_keywords,
"Drug Offenses" = drug_offenses_keywords,
"Violent Crimes" = violent_crimes_keywords,
"Sex Crimes" = sex_crimes_keywords,
"Crimes of Incarceration/Criminal Identity" = incarceration_related_crimes,
"White-Collar and Fraud" = white_collar_fraud_crimes,
"Motor Vehicle Crimes" = traffic_crimes,
"Abuse/Neglect Crimes" = abuse_neglect_crimes)
# Create a new column for crime categories and initialize it as an empty list
charges_counts$crime_category <- vector('list', length(charges_counts$adjudicationcharge_descr))
# Loop through categories and apply rules
for (category in names(category_mapping)) {
keywords <- category_mapping[[category]]
matching_indices <- grepl(paste(keywords, collapse = "|"), charges_counts$adjudicationcharge_descr, ignore.case = TRUE)
# Append the category to the matching entries (instead of overwriting)
charges_counts$crime_category[matching_indices] <- lapply(charges_counts$crime_category[matching_indices], function(x) c(x, category))
}
# If a crime doesn't match any category, set it to "Other"
charges_counts$crime_category[sapply(charges_counts$crime_category, length) == 0] <- "Other"
filtered_charges <- charges_counts %>%
filter(sapply(crime_category, function(x) any(grepl("Burglary, Theft, Property Crimes", x, ignore.case = TRUE))))
datatable(unique(filtered_charges %>% select(adjudicationcharge_descr)), options = list(scrollX = TRUE, pageLength = 10, lengthMenu = c(10, 20, 50)))
filtered_charges <- charges_counts %>%
filter(sapply(crime_category, function(x) any(grepl("Crimes of Incarceration/Criminal Identity", x, ignore.case = TRUE))))
datatable(unique(filtered_charges %>% select(adjudicationcharge_descr)), options = list(scrollX = TRUE, pageLength = 10, lengthMenu = c(10, 20, 50)))
# Unnest the crime categories to separate overlapping categories
charges_counts <- charges_counts %>%
unnest(crime_category)
# Calculate the proportions for each category
crime_proportions <- charges_counts %>%
group_by(crime_category) %>%
summarize(total_count_charges = sum(charge_count)) %>%
mutate(relative_proportion = total_count_charges / sum(charges_counts$charge_count))
# View the resulting table
kable(crime_proportions) %>%
kable_styling(latex_options = 'hold_position')
crime_category | total_count_charges | relative_proportion |
---|---|---|
Abuse/Neglect Crimes | 3699 | 0.0056014 |
Burglary, Theft, Property Crimes | 193685 | 0.2932973 |
Crimes of Incarceration/Criminal Identity | 46164 | 0.0699062 |
Drug Offenses | 105492 | 0.1597466 |
Motor Vehicle Crimes | 11710 | 0.0177325 |
Other | 39516 | 0.0598391 |
Sex Crimes | 72645 | 0.1100063 |
Violent Crimes | 152804 | 0.2313911 |
White-Collar and Fraud | 34656 | 0.0524796 |
crimes_categories <- charges_counts %>%
group_by(crime_category) %>%
# Arrange by charge_count in descending order within each group
arrange(desc(charge_count)) %>%
# Take the top 3 rows within each group
slice(1:3) %>%
# Select the columns you want to display
select(crime_category, adjudicationcharge_descr, charge_count)
result <- crimes_categories %>%
group_by(crime_category) %>%
summarize(
Top_3_counts = paste(adjudicationcharge_descr, charge_count, sep = ", ", collapse = '; ')
)
kable(result) %>%
kable_styling(latex_options = "hold_position")
crime_category | Top_3_counts |
---|---|
Abuse/Neglect Crimes | AGGRAVATED CHILD ABUSE, 1085; WILLFUL CHILD ABUSE, 889; CHILD NEGLECT, 583 |
Burglary, Theft, Property Crimes | BURGUNOCCSTRUC/CV OR ATT., 42369; BURG/DWELL/OCCUP.CONVEY, 29840; GRAND THEFT,300 L/5,000, 27729 |
Crimes of Incarceration/Criminal Identity | BATT.LEO/FIRFGT/EMS/ETC., 6780; RESISTING OFFICER W/VIOLEN., 5510; FLEE LEO/NO REGARD, 4237 |
Drug Offenses | COCAINE - POSSESSION, 21831; COCAINE-SALE/MANUF/DELIV., 16806; POSS.CONTROL.SUBS/OTHER, 12225 |
Motor Vehicle Crimes | DRIV W/LIC S/R/C/D FELONY, 6170; DUI MANSLAUGHTER, 1177; FELONY DWLSR, 773 |
Other | FEL/DELI W/GUN/CONC WPN/AMMO, 19081; CARRYING CONCEALED FIREARM, 4211; SHOOT/THROW MISSILE-BLDG/VEH., 2951 |
Sex Crimes | POSS PHOTO ETC CHILD SEX PERF, 29524; SEX BAT BY ADULT/VCTM LT 12, 7443; L/L MOLEST V<12 OFF 18, 4992 |
Violent Crimes | ROBB. GUN OR DEADLY WPN, 28564; ROBB. NO GUN/DDLY.WPN, 12381; AGG ASSLT-W/WPN NO INTENT TO K, 11135 |
White-Collar and Fraud | UTTER FORGED INSTRUMENT, 5970; FALS INF. TO PWNBRKR<300, 4861; FORGERY/UTTERING, 3074 |
While I initially intended to analyze probation/parole violations among individuals currently incarcerated with a previous history of incarceration using this data, it is not currently possible to conduct a straightforward analysis. This is because the Florida Department of Corrections categorizes individuals who are currently incarcerated and have violated their probation/parole under the charge for which they were originally sentenced to probation or parole.
For instance, let’s consider the following record, with all identifying information censored. This person was initially incarcerated in 1961 for an unspecified sexual battery crime and received a life sentence. It is important to note that the meaning of a life sentence in 1961 differed significantly from its present-day interpretation. They were released on parole in 1967. After 17 years of freedom, they were arrested in Orange County. Although they were not apparently convicted of a new crime, their detainment resulted in the revocation of their parole, and they have been in prison ever since.
However, the FDOC incorrectly lists this person as currently in prison for the 1961 unspecified sexual battery offense. There are several issues with this, the most significant being that it is not true. This person is NOT in prison for any form of sexual battery, but rather is still ensnared in the legal fallout from the 1961 conviction – after 17 years of freedom, these are different things, certainly.
fist_timers_crimes <- merge(first_timers[,1], Offenses_CPS %>% select(DCNumber, adjudicationcharge_descr), by = 'DCNumber')
first_timers_cats <- merge(fist_timers_crimes, crimes_categories, by = 'adjudicationcharge_descr') %>% select(DCNumber, crime_category)
first_time_result <- first_timers_cats %>%
group_by(DCNumber) %>%
mutate(crimes_categories = paste(crime_category, collapse = "; ")) %>%
select(-crime_category) %>%
unique()
first_time_result_counts <- first_time_result %>%
separate_rows(crimes_categories, sep = "; ") %>%
count(DCNumber, crimes_categories) %>%
pivot_wider(names_from = crimes_categories, values_from = n, values_fill = 0)
result_first_timers <- data.frame(Category = character(0), Proportion = numeric(0))
categories <- colnames(first_time_result_counts)[-1]
for (category in categories) {
num_associated_rows <- first_time_result_counts %>%
filter(get(category) > 0) %>%
nrow()
proportion <- round(num_associated_rows / nrow(first_time_result_counts), 3)
result_first_timers <- rbind(result_first_timers, data.frame(Category = category, Percent = proportion * 100))
}
second_timers <- times_in %>% filter(times_in==2)
second_timers_crimes <- merge(second_timers[,1], Offenses_CPS %>% select(DCNumber, adjudicationcharge_descr), by = 'DCNumber')
second_timers_cats <- merge(second_timers_crimes, crimes_categories, by = 'adjudicationcharge_descr') %>% select(DCNumber, crime_category)
second_time_result <- second_timers_cats %>%
group_by(DCNumber) %>%
mutate(crimes_categories = paste(crime_category, collapse = "; ")) %>%
select(-crime_category) %>%
unique()
second_time_result_counts <- second_time_result %>%
separate_rows(crimes_categories, sep = "; ") %>%
count(DCNumber, crimes_categories) %>%
pivot_wider(names_from = crimes_categories, values_from = n, values_fill = 0)
result_second_timers <- data.frame(Category = character(0), Proportion = numeric(0))
categories <- colnames(second_time_result_counts)[-1]
for (category in categories) {
num_associated_rows <- second_time_result_counts %>%
filter(get(category) > 0) %>%
nrow()
proportion <- round(num_associated_rows / nrow(second_time_result_counts), 3)
result_second_timers <- rbind(result_second_timers, data.frame(Category = category, Percent = proportion * 100))
}
third_timers <- times_in %>% filter(times_in==3)
third_timers_crimes <- merge(third_timers[,1], Offenses_CPS %>% select(DCNumber, adjudicationcharge_descr), by = 'DCNumber')
third_timers_cats <- merge(third_timers_crimes, crimes_categories, by = 'adjudicationcharge_descr') %>% select(DCNumber, crime_category)
third_time_result <- third_timers_cats %>%
group_by(DCNumber) %>%
mutate(crimes_categories = paste(crime_category, collapse = "; ")) %>%
select(-crime_category) %>%
unique()
third_time_result_counts <- third_time_result %>%
separate_rows(crimes_categories, sep = "; ") %>%
count(DCNumber, crimes_categories) %>%
pivot_wider(names_from = crimes_categories, values_from = n, values_fill = 0)
result_third_timers <- data.frame(Category = character(0), Proportion = numeric(0))
categories <- colnames(third_time_result_counts)[-1]
for (category in categories) {
num_associated_rows <- third_time_result_counts %>%
filter(get(category) > 0) %>%
nrow()
proportion <- round(num_associated_rows / nrow(third_time_result_counts), 3)
result_third_timers <- rbind(result_third_timers, data.frame(Category = category, Percent = proportion * 100))
}
fourth_timers <- times_in %>% filter(times_in == 4)
fourth_timers_crimes <- merge(fourth_timers[, 1], Offenses_CPS %>% select(DCNumber, adjudicationcharge_descr), by = 'DCNumber')
fourth_timers_cats <- merge(fourth_timers_crimes, crimes_categories, by = 'adjudicationcharge_descr') %>% select(DCNumber, crime_category)
fourth_time_result <- fourth_timers_cats %>%
group_by(DCNumber) %>%
mutate(crimes_categories = paste(crime_category, collapse = "; ")) %>%
select(-crime_category) %>%
unique()
fourth_time_result_counts <- fourth_time_result %>%
separate_rows(crimes_categories, sep = "; ") %>%
count(DCNumber, crimes_categories) %>%
pivot_wider(names_from = crimes_categories, values_from = n, values_fill = 0)
result_fourth_timers <- data.frame(Category = character(0), Proportion = numeric(0))
categories <- colnames(fourth_time_result_counts)[-1]
for (category in categories) {
num_associated_rows <- fourth_time_result_counts %>%
filter(get(category) > 0) %>%
nrow()
proportion <- round(num_associated_rows / nrow(fourth_time_result_counts), 3)
result_fourth_timers <- rbind(result_fourth_timers, data.frame(Category = category, Percent = proportion * 100))
}
fifth_timers <- times_in %>% filter(times_in == 5)
fifth_timers_crimes <- merge(fifth_timers[, 1], Offenses_CPS %>% select(DCNumber, adjudicationcharge_descr), by = 'DCNumber')
fifth_timers_cats <- merge(fifth_timers_crimes, crimes_categories, by = 'adjudicationcharge_descr') %>% select(DCNumber, crime_category)
fifth_time_result <- fifth_timers_cats %>%
group_by(DCNumber) %>%
mutate(crimes_categories = paste(crime_category, collapse = "; ")) %>%
select(-crime_category) %>%
unique()
fifth_time_result_counts <- fifth_time_result %>%
separate_rows(crimes_categories, sep = "; ") %>%
count(DCNumber, crimes_categories) %>%
pivot_wider(names_from = crimes_categories, values_from = n, values_fill = 0)
result_fifth_timers <- data.frame(Category = character(0), Proportion = numeric(0))
categories <- colnames(fifth_time_result_counts)[-1]
for (category in categories) {
num_associated_rows <- fifth_time_result_counts %>%
filter(get(category) > 0) %>%
nrow()
proportion <- round(num_associated_rows / nrow(fifth_time_result_counts), 3)
result_fifth_timers <- rbind(result_fifth_timers, data.frame(Category = category, Percent = proportion * 100))
}
six_or_more_timers <- times_in %>% filter(times_in >= 6)
six_or_more_timers_crimes <- merge(six_or_more_timers[, 1], Offenses_CPS %>% select(DCNumber, adjudicationcharge_descr), by = 'DCNumber')
six_or_more_timers_cats <- merge(six_or_more_timers_crimes, crimes_categories, by = 'adjudicationcharge_descr') %>% select(DCNumber, crime_category)
six_or_more_time_result <- six_or_more_timers_cats %>%
group_by(DCNumber) %>%
mutate(crimes_categories = paste(crime_category, collapse = "; ")) %>%
select(-crime_category) %>%
unique()
six_or_more_time_result_counts <- six_or_more_time_result %>%
separate_rows(crimes_categories, sep = "; ") %>%
count(DCNumber, crimes_categories) %>%
pivot_wider(names_from = crimes_categories, values_from = n, values_fill = 0)
result_six_or_more_timers <- data.frame(Category = character(0), Proportion = numeric(0))
categories <- colnames(six_or_more_time_result_counts)[-1]
for (category in categories) {
num_associated_rows <- six_or_more_time_result_counts %>%
filter(get(category) > 0) %>%
nrow()
proportion <- round(num_associated_rows / nrow(six_or_more_time_result_counts), 3)
result_six_or_more_timers <- rbind(result_six_or_more_timers, data.frame(Category = category, Percent = proportion * 100))
}
ordered_first_timers <- result_first_timers %>% arrange(Category)
ordered_second_timers <- result_second_timers %>% arrange(Category)
ordered_third_timers <- result_third_timers %>% arrange(Category)
ordered_fourth_timers <- result_fourth_timers %>% arrange(Category)
ordered_fifth_timers <- result_fifth_timers %>% arrange(Category)
ordered_six_more_timers <- result_six_or_more_timers %>% arrange(Category)
pros_across_times <- cbind(ordered_first_timers,
ordered_second_timers[2],
ordered_third_timers[2],
ordered_fourth_timers[2],
ordered_fifth_timers[2],
ordered_six_more_timers[2])
new_column_names <- c("Crime Category", "First Commit.", "Second Commit.", "Third Commit.", "Fourth Commit.", "Fifth Commit.", "Sixth+ Commit.")
names(pros_across_times) <- new_column_names
# Pivot the data
data_long <- pros_across_times %>%
pivot_longer(cols = -`Crime Category`, names_to = "Commit", values_to = "Value")
# Define the custom order for Commit
custom_order <- c("First Commit.", "Second Commit.", "Third Commit.", "Fourth Commit.", "Fifth Commit.", "Sixth+ Commit.")
# Apply the custom order to the Commit variable
data_long$Commit <- factor(data_long$Commit, levels = custom_order)
# Create the ggplot
ggplot(data_long, aes(x = Commit, y = Value, color = `Crime Category`,
group = `Crime Category`, linetype = `Crime Category`)) +
geom_line(linewidth = 2) +
geom_point(aes(shape = `Crime Category`), size = 3.5) +
labs(x = "Commitment", y = "Percent", title = "Percent Currently Associated with Crime Category Across Number of FDOC Stays") +
theme_minimal() +
theme(axis.text.x = element_text(angle = 90, hjust = 1)) +
theme(legend.position = "bottom")
kable(pros_across_times) %>%
kable_styling(latex_options = "hold_position")
Crime Category | First Commit. | Second Commit. | Third Commit. | Fourth Commit. | Fifth Commit. | Sixth+ Commit. |
---|---|---|---|---|---|---|
Abuse/Neglect Crimes | 4.6 | 2.2 | 1.9 | 1.2 | 1.2 | 0.5 |
Burglary, Theft, Property Crimes | 16.5 | 25.9 | 27.0 | 26.9 | 32.2 | 36.1 |
Crimes of Incarceration/Criminal Identity | 8.4 | 11.4 | 12.2 | 13.7 | 11.9 | 10.3 |
Drug Offenses | 14.8 | 21.9 | 26.5 | 29.8 | 31.5 | 34.1 |
Motor Vehicle Crimes | 4.3 | 3.5 | 4.8 | 6.2 | 5.5 | 6.2 |
Other | 22.7 | 33.7 | 30.5 | 24.2 | 22.5 | 14.9 |
Sex Crimes | 17.0 | 4.5 | 2.9 | 2.2 | 1.6 | 1.6 |
Violent Crimes | 37.5 | 37.1 | 33.4 | 32.1 | 29.6 | 25.5 |
White-Collar and Fraud | 0.9 | 1.0 | 1.8 | 1.9 | 1.6 | 1.4 |
Okay, so among those currently incarcerated for their first commitment, 4.6% of them have Abuse/Neglect crimes associated with their current incarceration. However, this percentage drops to 2.2% for those serving time for their second incarceration. Furthermore, we see a further decrease to 1.9% across the population of those who are serving their third sentence in FDOC, and so on.
# I'm running a Mann-Kendall test for trends, really I should prob run a chi squared, but I don't know how to account
# for the overlaping crime categories (rape, for example, is both a sex and violent crime) - Mann-Kendall should suffice
# our investigation, however. If you feel that chi squared or another test is needed then reach out and we'll make it happen.
mannkendall_results <- apply(pros_across_times[,-1], MARGIN=1, FUN=MannKendall)
# Add the results as a new column to the data frame
pros_across_times$tau <- sapply(mannkendall_results,function(x) x$tau)
pros_across_times$pvalue <- sapply(mannkendall_results,function(x) x$sl)
sigs_across_times <- pros_across_times %>%
filter(pvalue<= 0.05) %>%
select(`Crime Category`, tau, pvalue)
kable(sigs_across_times) %>%
kable_styling(latex_options = "hold_position")
Crime Category | tau | pvalue |
---|---|---|
Abuse/Neglect Crimes | -0.9660917 | 0.0128989 |
Burglary, Theft, Property Crimes | 0.8666666 | 0.0241705 |
Drug Offenses | 0.9999999 | 0.0085349 |
Sex Crimes | -0.9660917 | 0.0128989 |
Violent Crimes | -0.9999999 | 0.0085349 |
We do have strong statistical evidence that indicates a trend of decreasing Abuse/Neglect Crimes, Sex Crimes, and Violent Crimes. We also see in increase in the percentage of Burglary, Theft, Property Crimes, as well as Drug Offenses.
I can create a table for individual crime adjudications, similar to how I presented a table and graph displaying proportions of crime categories across successive incarcerations. This table would show statistically significant trends based on the number of incarcerations. However, conducting this analysis poses a challenge due to the large number of potential adjudications. To mitigate the risk of type 1 errors, I am currently exploring more conservative tests that can be applied, in addition to the Mann-Kendall test.
Following that, I will analyze correlations and relationships among multiple incarcerations per individual — I will compare the current charges of individuals currently incarcerated with their charges of previous incarcerations.
Finally, I will examine this data based on the county of last conviction.
I anticipate identifying further analysis opportunities as I complete these tasks.
charges_cats <- charges_counts %>% select(-charge_count)
first_abuse <- left_join(charges_cats %>% filter(crime_category=='Abuse/Neglect Crimes'),fist_timers_crimes, by = 'adjudicationcharge_descr') %>% select(-crime_category)
first_abuse <- first_abuse %>%
pivot_wider(names_from = adjudicationcharge_descr, values_from = adjudicationcharge_descr, values_fn = length, values_fill = 0) %>% select(-DCNumber)
first_abuse[first_abuse > 1] <- 1
first_abuse <- first_abuse %>% summarise_all(sum)
abuse <- round(first_abuse/1364,2)
abuse_1 <- abuse %>%
pivot_longer(cols = everything(), names_to = "crime", values_to = "First Commit.") %>% arrange(desc(`First Commit.`)) %>% slice(1:10)
second_abuse <- left_join(charges_cats %>% filter(crime_category=='Abuse/Neglect Crimes'),second_timers_crimes, by = 'adjudicationcharge_descr') %>% select(-crime_category)
second_abuse <- second_abuse %>%
pivot_wider(names_from = adjudicationcharge_descr, values_from = adjudicationcharge_descr, values_fn = length, values_fill = 0) %>% select(-DCNumber) #320
second_abuse[second_abuse > 1] <- 1
second_abuse <- second_abuse %>% summarise_all(sum)
abuse <- round(second_abuse/320,2)
abuse_2 <- abuse %>%
pivot_longer(cols = everything(), names_to = "crime", values_to = "Second Commit.") %>% arrange(desc(`Second Commit.`))
abuse_commits <- left_join(abuse_1,abuse_2, by = "crime")
third_abuse <- left_join(charges_cats %>% filter(crime_category=='Abuse/Neglect Crimes'),third_timers_crimes, by = 'adjudicationcharge_descr') %>% select(-crime_category)
third_abuse <- third_abuse %>%
pivot_wider(names_from = adjudicationcharge_descr, values_from = adjudicationcharge_descr, values_fn = length, values_fill = 0) %>% select(-DCNumber) #158
third_abuse[third_abuse > 1] <- 1
third_abuse <- third_abuse %>% summarise_all(sum)
abuse <- round(third_abuse/158,2)
abuse_3 <- abuse %>%
pivot_longer(cols = everything(), names_to = "crime", values_to = "Third Commit.") %>% arrange(desc(`Third Commit.`))
abuse_commits <- left_join(abuse_commits,abuse_3, by = "crime")
fourth_abuse <- left_join(charges_cats %>% filter(crime_category=='Abuse/Neglect Crimes'),fourth_timers_crimes, by = 'adjudicationcharge_descr') %>% select(-crime_category)
fourth_abuse <- fourth_abuse %>%
pivot_wider(names_from = adjudicationcharge_descr, values_from = adjudicationcharge_descr, values_fn = length, values_fill = 0) %>% select(-DCNumber) #59
fourth_abuse[fourth_abuse > 1] <- 1
fourth_abuse <- fourth_abuse %>% summarise_all(sum)
abuse <- round(fourth_abuse/59,2)
abuse_4 <- abuse %>%
pivot_longer(cols = everything(), names_to = "crime", values_to = "Fourth Commit.") %>% arrange(desc(`Fourth Commit.`))
abuse_commits <- left_join(abuse_commits,abuse_4, by = "crime")
fifth_abuse <- left_join(charges_cats %>% filter(crime_category=='Abuse/Neglect Crimes'),fifth_timers_crimes, by = 'adjudicationcharge_descr') %>% select(-crime_category)
fifth_abuse <- fifth_abuse %>%
pivot_wider(names_from = adjudicationcharge_descr, values_from = adjudicationcharge_descr, values_fn = length, values_fill = 0) %>% select(-DCNumber) #32
fifth_abuse[fifth_abuse > 1] <- 1
fifth_abuse <- fifth_abuse %>% summarise_all(sum)
abuse <- round(fifth_abuse/32,2)
abuse_5 <- abuse %>%
pivot_longer(cols = everything(), names_to = "crime", values_to = "Fifth Commit.") %>% arrange(desc(`Fifth Commit.`))
abuse_commits <- left_join(abuse_commits,abuse_5, by = "crime")
sixth_abuse <- left_join(charges_cats %>% filter(crime_category=='Abuse/Neglect Crimes'),six_or_more_timers_crimes, by = 'adjudicationcharge_descr') %>% select(-crime_category)
sixth_abuse <- sixth_abuse %>%
pivot_wider(names_from = adjudicationcharge_descr, values_from = adjudicationcharge_descr, values_fn = length, values_fill = 0) %>% select(-DCNumber) #27
sixth_abuse[sixth_abuse > 1] <- 1
sixth_abuse <- sixth_abuse %>% summarise_all(sum)
abuse <- round(sixth_abuse/27,2)
abuse_6 <- abuse %>%
pivot_longer(cols = everything(), names_to = "crime", values_to = "Sixth+ Commit.") %>% arrange(desc(`Sixth+ Commit.`))
abuse_commits <- left_join(abuse_commits,abuse_6, by = "crime")
write.csv(abuse_commits,"~/vizclass/Abuse_Neglect_Crimes.csv")
yay now I just got to do that one more time for each of the other 8 crime cats. no biggie do it tomorrow.
first_burg <- left_join(charges_cats %>% filter(crime_category=='Burglary, Theft, Property Crimes'),fist_timers_crimes, by = 'adjudicationcharge_descr') %>% select(-crime_category)
first_burg <- first_burg %>%
pivot_wider(names_from = adjudicationcharge_descr, values_from = adjudicationcharge_descr, values_fn = length, values_fill = 0) %>% select(-DCNumber)
first_burg[first_burg > 1] <- 1
first_burg <- first_burg %>% summarise_all(sum)
burg <- round(first_burg/9765,2)
burg1 <- burg %>%
pivot_longer(cols = everything(), names_to = "crime", values_to = "First Commit.") %>% arrange(desc(`First Commit.`)) %>% slice(1:10)
second_burg <- left_join(charges_cats %>% filter(crime_category=='Burglary, Theft, Property Crimes'),second_timers_crimes, by = 'adjudicationcharge_descr') %>% select(-crime_category)
second_burg <- second_burg %>%
pivot_wider(names_from = adjudicationcharge_descr, values_from = adjudicationcharge_descr, values_fn = length, values_fill = 0) %>% select(-DCNumber) #5970
second_burg[second_burg > 1] <- 1
second_burg <- second_burg %>% summarise_all(sum)
burg <- round(second_burg/5970,2)
burg_2 <- burg %>%
pivot_longer(cols = everything(), names_to = "crime", values_to = "Second Commit.") %>% arrange(desc(`Second Commit.`))
burg_commits <- left_join(burg1,burg_2, by = "crime")
third_burg <- left_join(charges_cats %>% filter(crime_category=='Burglary, Theft, Property Crimes'),third_timers_crimes, by = 'adjudicationcharge_descr') %>% select(-crime_category)
third_burg <- third_burg %>%
pivot_wider(names_from = adjudicationcharge_descr, values_from = adjudicationcharge_descr, values_fn = length, values_fill = 0) %>% select(-DCNumber) #158
third_burg[third_burg > 1] <- 1
third_burg <- third_burg %>% summarise_all(sum)
burg <- round(third_burg/3447,2)
burg_3 <- burg %>%
pivot_longer(cols = everything(), names_to = "crime", values_to = "Third Commit.") %>% arrange(desc(`Third Commit.`))
burg_commits <- left_join(burg_commits,burg_3, by = "crime")
fourth_burg <- left_join(charges_cats %>% filter(crime_category=='Burglary, Theft, Property Crimes'),fourth_timers_crimes, by = 'adjudicationcharge_descr') %>% select(-crime_category)
fourth_burg <- fourth_burg %>%
pivot_wider(names_from = adjudicationcharge_descr, values_from = adjudicationcharge_descr, values_fn = length, values_fill = 0) %>% select(-DCNumber) #59
fourth_burg[fourth_burg > 1] <- 1
fourth_burg <- fourth_burg %>% summarise_all(sum)
burg <- round(fourth_burg/1932,2)
burg_4 <- burg %>%
pivot_longer(cols = everything(), names_to = "crime", values_to = "Fourth Commit.") %>% arrange(desc(`Fourth Commit.`))
burg_commits <- left_join(burg_commits,burg_4, by = "crime")
fifth_burg <- left_join(charges_cats %>% filter(crime_category=='Burglary, Theft, Property Crimes'),fifth_timers_crimes, by = 'adjudicationcharge_descr') %>% select(-crime_category)
fifth_burg <- fifth_burg %>%
pivot_wider(names_from = adjudicationcharge_descr, values_from = adjudicationcharge_descr, values_fn = length, values_fill = 0) %>% select(-DCNumber) #32
fifth_burg[fifth_burg > 1] <- 1
fifth_burg <- fifth_burg %>% summarise_all(sum)
burg <- round(fifth_burg/1211,2)
burg_5 <- burg %>%
pivot_longer(cols = everything(), names_to = "crime", values_to = "Fifth Commit.") %>% arrange(desc(`Fifth Commit.`))
burg_commits <- left_join(burg_commits,burg_5, by = "crime")
sixth_burg <- left_join(charges_cats %>% filter(crime_category=='Burglary, Theft, Property Crimes'),six_or_more_timers_crimes, by = 'adjudicationcharge_descr') %>% select(-crime_category)
sixth_burg <- sixth_burg %>%
pivot_wider(names_from = adjudicationcharge_descr, values_from = adjudicationcharge_descr, values_fn = length, values_fill = 0) %>% select(-DCNumber) #27
sixth_burg[sixth_burg > 1] <- 1
sixth_burg <- sixth_burg %>% summarise_all(sum)
burg <- round(sixth_burg/1975,2)
burg_6 <- burg %>%
pivot_longer(cols = everything(), names_to = "crime", values_to = "Sixth+ Commit.") %>% arrange(desc(`Sixth+ Commit.`))
burg_commits <- left_join(burg_commits,burg_6, by = "crime")
write.csv(burg_commits,'burg_commits.csv')
okay, only 7 more?
first_id <- left_join(charges_cats %>% filter(crime_category=='Crimes of Incarceration/Criminal Identity'),fist_timers_crimes, by = 'adjudicationcharge_descr') %>% select(-crime_category)
first_id <- first_id %>%
pivot_wider(names_from = adjudicationcharge_descr, values_from = adjudicationcharge_descr, values_fn = length, values_fill = 0) %>% select(-DCNumber)
first_id[first_id > 1] <- 1
first_id <- first_id %>% summarise_all(sum)
id <- round(first_id/5338,2)
id1 <- id %>%
pivot_longer(cols = everything(), names_to = "crime", values_to = "First Commit.") %>% arrange(desc(`First Commit.`)) %>% slice(1:10)
second_id <- left_join(charges_cats %>% filter(crime_category=='Crimes of Incarceration/Criminal Identity'),second_timers_crimes, by = 'adjudicationcharge_descr') %>% select(-crime_category)
second_id <- second_id %>%
pivot_wider(names_from = adjudicationcharge_descr, values_from = adjudicationcharge_descr, values_fn = length, values_fill = 0) %>% select(-DCNumber) #5970
second_id[second_id > 1] <- 1
second_id <- second_id %>% summarise_all(sum)
id <- round(second_id/3612,2)
id2 <- id %>%
pivot_longer(cols = everything(), names_to = "crime", values_to = "Second Commit.") %>% arrange(desc(`Second Commit.`))
id_commits <- left_join(id1,id2, by = "crime")
third_id <- left_join(charges_cats %>% filter(crime_category=='Crimes of Incarceration/Criminal Identity'),third_timers_crimes, by = 'adjudicationcharge_descr') %>% select(-crime_category)
third_id <- third_id %>%
pivot_wider(names_from = adjudicationcharge_descr, values_from = adjudicationcharge_descr, values_fn = length, values_fill = 0) %>% select(-DCNumber) #158
third_id[third_id > 1] <- 1
third_id <- third_id %>% summarise_all(sum)
id <- round(third_id/2730,2)
id_3 <- id %>%
pivot_longer(cols = everything(), names_to = "crime", values_to = "Third Commit.") %>% arrange(desc(`Third Commit.`))
id_commits <- left_join(id_commits,id_3, by = "crime")
fourth_id <- left_join(charges_cats %>% filter(crime_category=='Crimes of Incarceration/Criminal Identity'),fourth_timers_crimes, by = 'adjudicationcharge_descr') %>% select(-crime_category)
fourth_id <- fourth_id %>%
pivot_wider(names_from = adjudicationcharge_descr, values_from = adjudicationcharge_descr, values_fn = length, values_fill = 0) %>% select(-DCNumber) #59
fourth_id[fourth_id > 1] <- 1
fourth_id <- fourth_id %>% summarise_all(sum)
id <- round(fourth_id/1487,2)
id4 <- id %>%
pivot_longer(cols = everything(), names_to = "crime", values_to = "Fourth Commit.") %>% arrange(desc(`Fourth Commit.`))
id_commits <- left_join(id_commits,id4, by = "crime")
fifth_id <- left_join(charges_cats %>% filter(crime_category=='Crimes of Incarceration/Criminal Identity'),fifth_timers_crimes, by = 'adjudicationcharge_descr') %>% select(-crime_category)
fifth_id <- fifth_id %>%
pivot_wider(names_from = adjudicationcharge_descr, values_from = adjudicationcharge_descr, values_fn = length, values_fill = 0) %>% select(-DCNumber) #32
fifth_id[fifth_id > 1] <- 1
fifth_id <- fifth_id %>% summarise_all(sum)
id <- round(fifth_id/821,2)
id5 <- id %>%
pivot_longer(cols = everything(), names_to = "crime", values_to = "Fifth Commit.") %>% arrange(desc(`Fifth Commit.`))
id_commits <- left_join(id_commits,id5, by = "crime")
sixth_id <- left_join(charges_cats %>% filter(crime_category=='Crimes of Incarceration/Criminal Identity'),six_or_more_timers_crimes, by = 'adjudicationcharge_descr') %>% select(-crime_category)
sixth_id <- sixth_id %>%
pivot_wider(names_from = adjudicationcharge_descr, values_from = adjudicationcharge_descr, values_fn = length, values_fill = 0) %>% select(-DCNumber) #27
sixth_id[sixth_id > 1] <- 1
sixth_id <- sixth_id %>% summarise_all(sum)
id <- round(sixth_id/1093,2)
id6 <- id %>%
pivot_longer(cols = everything(), names_to = "crime", values_to = "Sixth+ Commit.") %>% arrange(desc(`Sixth+ Commit.`))
id_commits <- left_join(id_commits,id6, by = "crime")
first_drug <- left_join(charges_cats %>% filter(crime_category=='Drug Offenses'),fist_timers_crimes, by = 'adjudicationcharge_descr') %>% select(-crime_category)
first_drug <- first_drug %>%
pivot_wider(names_from = adjudicationcharge_descr, values_from = adjudicationcharge_descr, values_fn = length, values_fill = 0) %>% select(-DCNumber)
first_drug[first_drug > 1] <- 1
first_drug <- first_drug %>% summarise_all(sum)
drug <- round(first_drug/7590,2)
drug1 <- drug %>%
pivot_longer(cols = everything(), names_to = "crime", values_to = "First Commit.") %>% arrange(desc(`First Commit.`)) %>% slice(1:10)
second_drug <- left_join(charges_cats %>% filter(crime_category=='Drug Offenses'),second_timers_crimes, by = 'adjudicationcharge_descr') %>% select(-crime_category)
second_drug <- second_drug %>%
pivot_wider(names_from = adjudicationcharge_descr, values_from = adjudicationcharge_descr, values_fn = length, values_fill = 0) %>% select(-DCNumber) #5970
second_drug[second_drug > 1] <- 1
second_drug <- second_drug %>% summarise_all(sum)
drug <- round(second_drug/4721,2)
drug2 <- drug %>%
pivot_longer(cols = everything(), names_to = "crime", values_to = "Second Commit.") %>% arrange(desc(`Second Commit.`))
drug_commits <- left_join(drug1,drug2, by = "crime")
third_drug <- left_join(charges_cats %>% filter(crime_category=='Drug Offenses'),third_timers_crimes, by = 'adjudicationcharge_descr') %>% select(-crime_category)
third_drug <- third_drug %>%
pivot_wider(names_from = adjudicationcharge_descr, values_from = adjudicationcharge_descr, values_fn = length, values_fill = 0) %>% select(-DCNumber) #158
third_drug[third_drug > 1] <- 1
third_drug <- third_drug %>% summarise_all(sum)
drug <- round(third_drug/3120,2)
drug3 <- drug %>%
pivot_longer(cols = everything(), names_to = "crime", values_to = "Third Commit.") %>% arrange(desc(`Third Commit.`))
drug_commits <- left_join(drug_commits,drug3, by = "crime")
fourth_drug <- left_join(charges_cats %>% filter(crime_category=='Drug Offenses'),fourth_timers_crimes, by = 'adjudicationcharge_descr') %>% select(-crime_category)
fourth_drug <- fourth_drug %>%
pivot_wider(names_from = adjudicationcharge_descr, values_from = adjudicationcharge_descr, values_fn = length, values_fill = 0) %>% select(-DCNumber) #59
fourth_drug[fourth_drug > 1] <- 1
fourth_drug <- fourth_drug %>% summarise_all(sum)
drug <- round(fourth_drug/1855,2)
drug4 <- drug %>%
pivot_longer(cols = everything(), names_to = "crime", values_to = "Fourth Commit.") %>% arrange(desc(`Fourth Commit.`))
drug_commits <- left_join(drug_commits,drug4, by = "crime")
fifth_drug <- left_join(charges_cats %>% filter(crime_category=='Drug Offenses'),fifth_timers_crimes, by = 'adjudicationcharge_descr') %>% select(-crime_category)
fifth_drug <- fifth_drug %>%
pivot_wider(names_from = adjudicationcharge_descr, values_from = adjudicationcharge_descr, values_fn = length, values_fill = 0) %>% select(-DCNumber) #32
fifth_drug[fifth_drug > 1] <- 1
fifth_drug <- fifth_drug %>% summarise_all(sum)
drug <- round(fifth_drug/1105,2)
drug5 <- drug %>%
pivot_longer(cols = everything(), names_to = "crime", values_to = "Fifth Commit.") %>% arrange(desc(`Fifth Commit.`))
drug_commits <- left_join(drug_commits,drug5, by = "crime")
sixth_drug <- left_join(charges_cats %>% filter(crime_category=='Drug Offenses'),six_or_more_timers_crimes, by = 'adjudicationcharge_descr') %>% select(-crime_category)
sixth_drug <- sixth_drug %>%
pivot_wider(names_from = adjudicationcharge_descr, values_from = adjudicationcharge_descr, values_fn = length, values_fill = 0) %>% select(-DCNumber) #27
sixth_drug[sixth_drug > 1] <- 1
sixth_drug <- sixth_drug %>% summarise_all(sum)
drug <- round(sixth_drug/1624,2)
drug6 <- drug %>%
pivot_longer(cols = everything(), names_to = "crime", values_to = "Sixth+ Commit.") %>% arrange(desc(`Sixth+ Commit.`))
drug_commits <- left_join(drug_commits,drug6, by = "crime")
write.csv(drug_commits, "~/vizclass/Drug_Offenses.csv")
first_id <- left_join(charges_cats %>% filter(crime_category=='Crimes of Incarceration/Criminal Identity'),fist_timers_crimes, by = 'adjudicationcharge_descr') %>% select(-crime_category)
first_id <- first_id %>%
pivot_wider(names_from = adjudicationcharge_descr, values_from = adjudicationcharge_descr, values_fn = length, values_fill = 0) %>% select(-DCNumber)
first_id[first_id > 1] <- 1
first_id <- first_id %>% summarise_all(sum)
id <- round(first_id/5338,2)
id1 <- id %>%
pivot_longer(cols = everything(), names_to = "crime", values_to = "First Commit.") %>% arrange(desc(`First Commit.`)) %>% slice(1:10)
second_id <- left_join(charges_cats %>% filter(crime_category=='Crimes of Incarceration/Criminal Identity'),second_timers_crimes, by = 'adjudicationcharge_descr') %>% select(-crime_category)
second_id <- second_id %>%
pivot_wider(names_from = adjudicationcharge_descr, values_from = adjudicationcharge_descr, values_fn = length, values_fill = 0) %>% select(-DCNumber) #5970
second_id[second_id > 1] <- 1
second_id <- second_id %>% summarise_all(sum)
id <- round(second_id/3612,2)
id2 <- id %>%
pivot_longer(cols = everything(), names_to = "crime", values_to = "Second Commit.") %>% arrange(desc(`Second Commit.`))
id_commits <- left_join(id1,id2, by = "crime")
third_id <- left_join(charges_cats %>% filter(crime_category=='Crimes of Incarceration/Criminal Identity'),third_timers_crimes, by = 'adjudicationcharge_descr') %>% select(-crime_category)
third_id <- third_id %>%
pivot_wider(names_from = adjudicationcharge_descr, values_from = adjudicationcharge_descr, values_fn = length, values_fill = 0) %>% select(-DCNumber) #158
third_id[third_id > 1] <- 1
third_id <- third_id %>% summarise_all(sum)
id <- round(third_id/2730,2)
id_3 <- id %>%
pivot_longer(cols = everything(), names_to = "crime", values_to = "Third Commit.") %>% arrange(desc(`Third Commit.`))
id_commits <- left_join(id_commits,id_3, by = "crime")
fourth_id <- left_join(charges_cats %>% filter(crime_category=='Crimes of Incarceration/Criminal Identity'),fourth_timers_crimes, by = 'adjudicationcharge_descr') %>% select(-crime_category)
fourth_id <- fourth_id %>%
pivot_wider(names_from = adjudicationcharge_descr, values_from = adjudicationcharge_descr, values_fn = length, values_fill = 0) %>% select(-DCNumber) #59
fourth_id[fourth_id > 1] <- 1
fourth_id <- fourth_id %>% summarise_all(sum)
id <- round(fourth_id/1487,2)
id4 <- id %>%
pivot_longer(cols = everything(), names_to = "crime", values_to = "Fourth Commit.") %>% arrange(desc(`Fourth Commit.`))
id_commits <- left_join(id_commits,id4, by = "crime")
fifth_id <- left_join(charges_cats %>% filter(crime_category=='Crimes of Incarceration/Criminal Identity'),fifth_timers_crimes, by = 'adjudicationcharge_descr') %>% select(-crime_category)
fifth_id <- fifth_id %>%
pivot_wider(names_from = adjudicationcharge_descr, values_from = adjudicationcharge_descr, values_fn = length, values_fill = 0) %>% select(-DCNumber) #32
fifth_id[fifth_id > 1] <- 1
fifth_id <- fifth_id %>% summarise_all(sum)
id <- round(fifth_id/821,2)
id5 <- id %>%
pivot_longer(cols = everything(), names_to = "crime", values_to = "Fifth Commit.") %>% arrange(desc(`Fifth Commit.`))
id_commits <- left_join(id_commits,id5, by = "crime")
sixth_id <- left_join(charges_cats %>% filter(crime_category=='Crimes of Incarceration/Criminal Identity'),six_or_more_timers_crimes, by = 'adjudicationcharge_descr') %>% select(-crime_category)
sixth_id <- sixth_id %>%
pivot_wider(names_from = adjudicationcharge_descr, values_from = adjudicationcharge_descr, values_fn = length, values_fill = 0) %>% select(-DCNumber) #27
sixth_id[sixth_id > 1] <- 1
sixth_id <- sixth_id %>% summarise_all(sum)
id <- round(sixth_id/1093,2)
id6 <- id %>%
pivot_longer(cols = everything(), names_to = "crime", values_to = "Sixth+ Commit.") %>% arrange(desc(`Sixth+ Commit.`))
id_commits <- left_join(id_commits,id6, by = "crime")
first_drug <- left_join(charges_cats %>% filter(crime_category=='Drug Offenses'),fist_timers_crimes, by = 'adjudicationcharge_descr') %>% select(-crime_category)
first_drug <- first_drug %>%
pivot_wider(names_from = adjudicationcharge_descr, values_from = adjudicationcharge_descr, values_fn = length, values_fill = 0) %>% select(-DCNumber)
first_drug[first_drug > 1] <- 1
first_drug <- first_drug %>% summarise_all(sum)
drug <- round(first_drug/7590,2)
drug1 <- drug %>%
pivot_longer(cols = everything(), names_to = "crime", values_to = "First Commit.") %>% arrange(desc(`First Commit.`)) %>% slice(1:10)
second_drug <- left_join(charges_cats %>% filter(crime_category=='Drug Offenses'),second_timers_crimes, by = 'adjudicationcharge_descr') %>% select(-crime_category)
second_drug <- second_drug %>%
pivot_wider(names_from = adjudicationcharge_descr, values_from = adjudicationcharge_descr, values_fn = length, values_fill = 0) %>% select(-DCNumber) #5970
second_drug[second_drug > 1] <- 1
second_drug <- second_drug %>% summarise_all(sum)
drug <- round(second_drug/4721,2)
drug2 <- drug %>%
pivot_longer(cols = everything(), names_to = "crime", values_to = "Second Commit.") %>% arrange(desc(`Second Commit.`))
drug_commits <- left_join(drug1,drug2, by = "crime")
third_drug <- left_join(charges_cats %>% filter(crime_category=='Drug Offenses'),third_timers_crimes, by = 'adjudicationcharge_descr') %>% select(-crime_category)
third_drug <- third_drug %>%
pivot_wider(names_from = adjudicationcharge_descr, values_from = adjudicationcharge_descr, values_fn = length, values_fill = 0) %>% select(-DCNumber) #158
third_drug[third_drug > 1] <- 1
third_drug <- third_drug %>% summarise_all(sum)
drug <- round(third_drug/3120,2)
drug3 <- drug %>%
pivot_longer(cols = everything(), names_to = "crime", values_to = "Third Commit.") %>% arrange(desc(`Third Commit.`))
drug_commits <- left_join(drug_commits,drug3, by = "crime")
fourth_drug <- left_join(charges_cats %>% filter(crime_category=='Drug Offenses'),fourth_timers_crimes, by = 'adjudicationcharge_descr') %>% select(-crime_category)
fourth_drug <- fourth_drug %>%
pivot_wider(names_from = adjudicationcharge_descr, values_from = adjudicationcharge_descr, values_fn = length, values_fill = 0) %>% select(-DCNumber) #59
fourth_drug[fourth_drug > 1] <- 1
fourth_drug <- fourth_drug %>% summarise_all(sum)
drug <- round(fourth_drug/1855,2)
drug4 <- drug %>%
pivot_longer(cols = everything(), names_to = "crime", values_to = "Fourth Commit.") %>% arrange(desc(`Fourth Commit.`))
drug_commits <- left_join(drug_commits,drug4, by = "crime")
fifth_drug <- left_join(charges_cats %>% filter(crime_category=='Drug Offenses'),fifth_timers_crimes, by = 'adjudicationcharge_descr') %>% select(-crime_category)
fifth_drug <- fifth_drug %>%
pivot_wider(names_from = adjudicationcharge_descr, values_from = adjudicationcharge_descr, values_fn = length, values_fill = 0) %>% select(-DCNumber) #32
fifth_drug[fifth_drug > 1] <- 1
fifth_drug <- fifth_drug %>% summarise_all(sum)
drug <- round(fifth_drug/1105,2)
drug5 <- drug %>%
pivot_longer(cols = everything(), names_to = "crime", values_to = "Fifth Commit.") %>% arrange(desc(`Fifth Commit.`))
drug_commits <- left_join(drug_commits,drug5, by = "crime")
sixth_drug <- left_join(charges_cats %>% filter(crime_category=='Drug Offenses'),six_or_more_timers_crimes, by = 'adjudicationcharge_descr') %>% select(-crime_category)
sixth_drug <- sixth_drug %>%
pivot_wider(names_from = adjudicationcharge_descr, values_from = adjudicationcharge_descr, values_fn = length, values_fill = 0) %>% select(-DCNumber) #27
sixth_drug[sixth_drug > 1] <- 1
sixth_drug <- sixth_drug %>% summarise_all(sum)
drug <- round(sixth_drug/1624,2)
drug6 <- drug %>%
pivot_longer(cols = everything(), names_to = "crime", values_to = "Sixth+ Commit.") %>% arrange(desc(`Sixth+ Commit.`))
drug_commits <- left_join(drug_commits,drug6, by = "crime")
write.csv(drug_commits, "~/vizclass/Drug_Offenses.csv")
Motor Vehicle Crimes
first_car <- left_join(charges_cats %>% filter(crime_category=='Motor Vehicle Crimes'),fist_timers_crimes, by = 'adjudicationcharge_descr') %>% select(-crime_category)
first_car <- first_car %>%
pivot_wider(names_from = adjudicationcharge_descr, values_from = adjudicationcharge_descr, values_fn = length, values_fill = 0) %>% select(-DCNumber)
first_car[first_car > 1] <- 1
first_car <- first_car %>% summarise_all(sum)
car <- round(first_car/1852,2)
car1 <- car %>%
pivot_longer(cols = everything(), names_to = "crime", values_to = "First Commit.") %>% arrange(desc(`First Commit.`)) %>% slice(1:10)
second_car <- left_join(charges_cats %>% filter(crime_category=='Motor Vehicle Crimes'),second_timers_crimes, by = 'adjudicationcharge_descr') %>% select(-crime_category)
second_car <- second_car %>%
pivot_wider(names_from = adjudicationcharge_descr, values_from = adjudicationcharge_descr, values_fn = length, values_fill = 0) %>% select(-DCNumber) #5970
second_car[second_car > 1] <- 1
second_car <- second_car %>% summarise_all(sum)
car <- round(second_car/640,2)
car2 <- car %>%
pivot_longer(cols = everything(), names_to = "crime", values_to = "Second Commit.") %>% arrange(desc(`Second Commit.`))
car_commits <- left_join(car1,car2, by = "crime")
third_car <- left_join(charges_cats %>% filter(crime_category=='Motor Vehicle Crimes'),third_timers_crimes, by = 'adjudicationcharge_descr') %>% select(-crime_category)
third_car <- third_car %>%
pivot_wider(names_from = adjudicationcharge_descr, values_from = adjudicationcharge_descr, values_fn = length, values_fill = 0) %>% select(-DCNumber) #158
third_car[third_car > 1] <- 1
third_car <- third_car %>% summarise_all(sum)
car <- round(third_car/442,2)
car3 <- car %>%
pivot_longer(cols = everything(), names_to = "crime", values_to = "Third Commit.") %>% arrange(desc(`Third Commit.`))
car_commits <- left_join(car_commits,car3, by = "crime")
fourth_car <- left_join(charges_cats %>% filter(crime_category=='Motor Vehicle Crimes'),fourth_timers_crimes, by = 'adjudicationcharge_descr') %>% select(-crime_category)
fourth_car <- fourth_car %>%
pivot_wider(names_from = adjudicationcharge_descr, values_from = adjudicationcharge_descr, values_fn = length, values_fill = 0) %>% select(-DCNumber) #59
fourth_car[fourth_car > 1] <- 1
fourth_car <- fourth_car %>% summarise_all(sum)
car <- round(fourth_car/297,2)
car4 <- car %>%
pivot_longer(cols = everything(), names_to = "crime", values_to = "Fourth Commit.") %>% arrange(desc(`Fourth Commit.`))
car_commits <- left_join(car_commits,car4, by = "crime")
fifth_car <- left_join(charges_cats %>% filter(crime_category=='Motor Vehicle Crimes'),fifth_timers_crimes, by = 'adjudicationcharge_descr') %>% select(-crime_category)
fifth_car <- fifth_car %>%
pivot_wider(names_from = adjudicationcharge_descr, values_from = adjudicationcharge_descr, values_fn = length, values_fill = 0) %>% select(-DCNumber) #32
fifth_car[fifth_car > 1] <- 1
fifth_car <- fifth_car %>% summarise_all(sum)
drug <- round(fifth_car/163,2)
drug5 <- drug %>%
pivot_longer(cols = everything(), names_to = "crime", values_to = "Fifth Commit.") %>% arrange(desc(`Fifth Commit.`))
car_commits <- left_join(car_commits,drug5, by = "crime")
sixth_car <- left_join(charges_cats %>% filter(crime_category=='Motor Vehicle Crimes'),six_or_more_timers_crimes, by = 'adjudicationcharge_descr') %>% select(-crime_category)
sixth_car <- sixth_car %>%
pivot_wider(names_from = adjudicationcharge_descr, values_from = adjudicationcharge_descr, values_fn = length, values_fill = 0) %>% select(-DCNumber) #27
sixth_car[sixth_car > 1] <- 1
sixth_car <- sixth_car %>% summarise_all(sum)
car <- round(sixth_car/242,2)
car6 <- car %>%
pivot_longer(cols = everything(), names_to = "crime", values_to = "Sixth+ Commit.") %>% arrange(desc(`Sixth+ Commit.`))
car_commits <- left_join(car_commits,car6, by = "crime")
write.csv(car_commits, "~/vizclass/Motor_Vehicle_Crimes.csv")
Other
first_other <- left_join(charges_cats %>% filter(crime_category=='Other'),fist_timers_crimes, by = 'adjudicationcharge_descr') %>% select(-crime_category)
first_other <- first_other %>%
pivot_wider(names_from = adjudicationcharge_descr, values_from = adjudicationcharge_descr, values_fn = length, values_fill = 0) %>% select(-DCNumber)
first_other[first_other > 1] <- 1
first_other <- first_other %>% summarise_all(sum)
other <- round(first_other/7786,2)
other1 <- other %>%
pivot_longer(cols = everything(), names_to = "crime", values_to = "First Commit.") %>% arrange(desc(`First Commit.`)) %>% slice(1:10)
second_other <- left_join(charges_cats %>% filter(crime_category=='Other'),second_timers_crimes, by = 'adjudicationcharge_descr') %>% select(-crime_category)
second_other <- second_other %>%
pivot_wider(names_from = adjudicationcharge_descr, values_from = adjudicationcharge_descr, values_fn = length, values_fill = 0) %>% select(-DCNumber) #5970
second_other[second_other > 1] <- 1
second_other <- second_other %>% summarise_all(sum)
other <- round(second_other/4951,2)
other2 <- other %>%
pivot_longer(cols = everything(), names_to = "crime", values_to = "Second Commit.") %>% arrange(desc(`Second Commit.`))
other_commits <- left_join(other1,other2, by = "crime")
third_other <- left_join(charges_cats %>% filter(crime_category=='Other'),third_timers_crimes, by = 'adjudicationcharge_descr') %>% select(-crime_category)
third_other <- third_other %>%
pivot_wider(names_from = adjudicationcharge_descr, values_from = adjudicationcharge_descr, values_fn = length, values_fill = 0) %>% select(-DCNumber) #158
third_other[third_other > 1] <- 1
third_other <- third_other %>% summarise_all(sum)
other <- round(third_other/2615,2)
other3 <- other %>%
pivot_longer(cols = everything(), names_to = "crime", values_to = "Third Commit.") %>% arrange(desc(`Third Commit.`))
other_commits <- left_join(other_commits,other3, by = "crime")
fourth_other <- left_join(charges_cats %>% filter(crime_category=='Other'),fourth_timers_crimes, by = 'adjudicationcharge_descr') %>% select(-crime_category)
fourth_other <- fourth_other %>%
pivot_wider(names_from = adjudicationcharge_descr, values_from = adjudicationcharge_descr, values_fn = length, values_fill = 0) %>% select(-DCNumber) #59
fourth_other[fourth_other > 1] <- 1
fourth_other <- fourth_other %>% summarise_all(sum)
other <- round(fourth_other/1243,2)
other4 <- other %>%
pivot_longer(cols = everything(), names_to = "crime", values_to = "Fourth Commit.") %>% arrange(desc(`Fourth Commit.`))
other_commits <- left_join(other_commits,other4, by = "crime")
fifth_other <- left_join(charges_cats %>% filter(crime_category=='Other'),fifth_timers_crimes, by = 'adjudicationcharge_descr') %>% select(-crime_category)
fifth_other <- fifth_other %>%
pivot_wider(names_from = adjudicationcharge_descr, values_from = adjudicationcharge_descr, values_fn = length, values_fill = 0) %>% select(-DCNumber) #32
fifth_other[fifth_other > 1] <- 1
fifth_other <- fifth_other %>% summarise_all(sum)
other <- round(fifth_other/697,2)
other5 <- other %>%
pivot_longer(cols = everything(), names_to = "crime", values_to = "Fifth Commit.") %>% arrange(desc(`Fifth Commit.`))
other_commits <- left_join(other_commits,other5, by = "crime")
sixth_other <- left_join(charges_cats %>% filter(crime_category=='Other'),six_or_more_timers_crimes, by = 'adjudicationcharge_descr') %>% select(-crime_category)
sixth_other <- sixth_other %>%
pivot_wider(names_from = adjudicationcharge_descr, values_from = adjudicationcharge_descr, values_fn = length, values_fill = 0) %>% select(-DCNumber) #27
sixth_other[sixth_other > 1] <- 1
sixth_other <- sixth_other %>% summarise_all(sum)
other <- round(sixth_other/758,2)
other6 <- other %>%
pivot_longer(cols = everything(), names_to = "crime", values_to = "Sixth+ Commit.") %>% arrange(desc(`Sixth+ Commit.`))
other_commits <- left_join(other_commits,other6, by = "crime")
write.csv(other_commits, "~/vizclass/Other.csv")
Sex
first_sex <- left_join(charges_cats %>% filter(crime_category=='Sex Crimes'),fist_timers_crimes, by = 'adjudicationcharge_descr') %>% select(-crime_category)
first_sex <- first_sex %>%
pivot_wider(names_from = adjudicationcharge_descr, values_from = adjudicationcharge_descr, values_fn = length, values_fill = 0) %>% select(-DCNumber)
first_sex[first_sex > 1] <- 1
first_sex <- first_sex %>% summarise_all(sum)
sex <- round(first_sex/8866,2)
sex1 <- sex %>%
pivot_longer(cols = everything(), names_to = "crime", values_to = "First Commit.") %>% arrange(desc(`First Commit.`)) %>% slice(1:10)
second_sex <- left_join(charges_cats %>% filter(crime_category=='Sex Crimes'),second_timers_crimes, by = 'adjudicationcharge_descr') %>% select(-crime_category)
second_sex <- second_sex %>%
pivot_wider(names_from = adjudicationcharge_descr, values_from = adjudicationcharge_descr, values_fn = length, values_fill = 0) %>% select(-DCNumber) #5970
second_sex[second_sex > 1] <- 1
second_sex <- second_sex %>% summarise_all(sum)
sex <- round(second_sex/1858,2)
sex2 <- sex %>%
pivot_longer(cols = everything(), names_to = "crime", values_to = "Second Commit.") %>% arrange(desc(`Second Commit.`))
sex_commits <- left_join(sex1,sex2, by = "crime")
third_sex <- left_join(charges_cats %>% filter(crime_category=='Sex Crimes'),third_timers_crimes, by = 'adjudicationcharge_descr') %>% select(-crime_category)
third_sex <- third_sex %>%
pivot_wider(names_from = adjudicationcharge_descr, values_from = adjudicationcharge_descr, values_fn = length, values_fill = 0) %>% select(-DCNumber) #158
third_sex[third_sex > 1] <- 1
third_sex <- third_sex %>% summarise_all(sum)
sex <- round(third_sex/810,2)
sex3 <- sex %>%
pivot_longer(cols = everything(), names_to = "crime", values_to = "Third Commit.") %>% arrange(desc(`Third Commit.`))
sex_commits <- left_join(sex_commits,sex3, by = "crime")
fourth_sex <- left_join(charges_cats %>% filter(crime_category=='Sex Crimes'),fourth_timers_crimes, by = 'adjudicationcharge_descr') %>% select(-crime_category)
fourth_sex <- fourth_sex %>%
pivot_wider(names_from = adjudicationcharge_descr, values_from = adjudicationcharge_descr, values_fn = length, values_fill = 0) %>% select(-DCNumber) #59
fourth_sex[fourth_sex > 1] <- 1
fourth_sex <- fourth_sex %>% summarise_all(sum)
sex <- round(fourth_sex/373,2)
sex4 <- sex %>%
pivot_longer(cols = everything(), names_to = "crime", values_to = "Fourth Commit.") %>% arrange(desc(`Fourth Commit.`))
sex_commits <- left_join(sex_commits,sex4, by = "crime")
fifth_sex <- left_join(charges_cats %>% filter(crime_category=='Sex Crimes'),fifth_timers_crimes, by = 'adjudicationcharge_descr') %>% select(-crime_category)
fifth_sex <- fifth_sex %>%
pivot_wider(names_from = adjudicationcharge_descr, values_from = adjudicationcharge_descr, values_fn = length, values_fill = 0) %>% select(-DCNumber) #32
fifth_sex[fifth_sex > 1] <- 1
fifth_sex <- fifth_sex %>% summarise_all(sum)
sex <- round(fifth_sex/181,2)
sex5 <- sex %>%
pivot_longer(cols = everything(), names_to = "crime", values_to = "Fifth Commit.") %>% arrange(desc(`Fifth Commit.`))
sex_commits <- left_join(sex_commits,sex5, by = "crime")
sixth_sex <- left_join(charges_cats %>% filter(crime_category=='Sex Crimes'),six_or_more_timers_crimes, by = 'adjudicationcharge_descr') %>% select(-crime_category)
sixth_sex <- sixth_sex %>%
pivot_wider(names_from = adjudicationcharge_descr, values_from = adjudicationcharge_descr, values_fn = length, values_fill = 0) %>% select(-DCNumber) #27
sixth_sex[sixth_sex > 1] <- 1
sixth_sex <- sixth_sex %>% summarise_all(sum)
sex <- round(sixth_sex/267,2)
sex6 <- sex %>%
pivot_longer(cols = everything(), names_to = "crime", values_to = "Sixth+ Commit.") %>% arrange(desc(`Sixth+ Commit.`))
sex_commits <- left_join(sex_commits,sex6, by = "crime")
write.csv(sex_commits, "~/vizclass/Sex_Crimes.csv")
first_hurt <- left_join(charges_cats %>% filter(crime_category=='Violent Crimes'),fist_timers_crimes, by = 'adjudicationcharge_descr') %>% select(-crime_category)
first_hurt <- first_hurt %>%
pivot_wider(names_from = adjudicationcharge_descr, values_from = adjudicationcharge_descr, values_fn = length, values_fill = 0) %>% select(-DCNumber)
first_hurt[first_hurt > 1] <- 1
first_hurt <- first_hurt %>% summarise_all(sum)
hurt <- round(first_hurt/25302,2)
hurt1 <- hurt %>%
pivot_longer(cols = everything(), names_to = "crime", values_to = "First Commit.") %>% arrange(desc(`First Commit.`)) %>% slice(1:10)
second_hurt <- left_join(charges_cats %>% filter(crime_category=='Violent Crimes'),second_timers_crimes, by = 'adjudicationcharge_descr') %>% select(-crime_category)
second_hurt <- second_hurt %>%
pivot_wider(names_from = adjudicationcharge_descr, values_from = adjudicationcharge_descr, values_fn = length, values_fill = 0) %>% select(-DCNumber) #5970
second_hurt[second_hurt > 1] <- 1
second_hurt <- second_hurt %>% summarise_all(sum)
hurt <- round(second_hurt/9809,2)
hurt2 <- hurt %>%
pivot_longer(cols = everything(), names_to = "crime", values_to = "Second Commit.") %>% arrange(desc(`Second Commit.`))
hurt_commits <- left_join(hurt1,hurt2, by = "crime")
third_hurt <- left_join(charges_cats %>% filter(crime_category=='Violent Crimes'),third_timers_crimes, by = 'adjudicationcharge_descr') %>% select(-crime_category)
third_hurt <- third_hurt %>%
pivot_wider(names_from = adjudicationcharge_descr, values_from = adjudicationcharge_descr, values_fn = length, values_fill = 0) %>% select(-DCNumber) #158
third_hurt[third_hurt > 1] <- 1
third_hurt <- third_hurt %>% summarise_all(sum)
hurt <- round(third_hurt/4849,2)
hurt3 <- hurt %>%
pivot_longer(cols = everything(), names_to = "crime", values_to = "Third Commit.") %>% arrange(desc(`Third Commit.`))
hurt_commits <- left_join(hurt_commits,hurt3, by = "crime")
fourth_hurt <- left_join(charges_cats %>% filter(crime_category=='Violent Crimes'),fourth_timers_crimes, by = 'adjudicationcharge_descr') %>% select(-crime_category)
fourth_hurt <- fourth_hurt %>%
pivot_wider(names_from = adjudicationcharge_descr, values_from = adjudicationcharge_descr, values_fn = length, values_fill = 0) %>% select(-DCNumber) #59
fourth_hurt[fourth_hurt > 1] <- 1
fourth_hurt <- fourth_hurt %>% summarise_all(sum)
hurt <- round(fourth_hurt/2626,2)
hurt4 <- hurt %>%
pivot_longer(cols = everything(), names_to = "crime", values_to = "Fourth Commit.") %>% arrange(desc(`Fourth Commit.`))
hurt_commits <- left_join(hurt_commits,hurt4, by = "crime")
fifth_hurt <- left_join(charges_cats %>% filter(crime_category=='Violent Crimes'),fifth_timers_crimes, by = 'adjudicationcharge_descr') %>% select(-crime_category)
fifth_hurt <- fifth_hurt %>%
pivot_wider(names_from = adjudicationcharge_descr, values_from = adjudicationcharge_descr, values_fn = length, values_fill = 0) %>% select(-DCNumber) #32
fifth_hurt[fifth_hurt > 1] <- 1
fifth_hurt <- fifth_hurt %>% summarise_all(sum)
hurt <- round(fifth_hurt/1343,2)
hurt5 <- hurt %>%
pivot_longer(cols = everything(), names_to = "crime", values_to = "Fifth Commit.") %>% arrange(desc(`Fifth Commit.`))
hurt_commits <- left_join(hurt_commits,hurt5, by = "crime")
sixth_hurt <- left_join(charges_cats %>% filter(crime_category=='Violent Crimes'),six_or_more_timers_crimes, by = 'adjudicationcharge_descr') %>% select(-crime_category)
sixth_hurt <- sixth_hurt %>%
pivot_wider(names_from = adjudicationcharge_descr, values_from = adjudicationcharge_descr, values_fn = length, values_fill = 0) %>% select(-DCNumber) #27
sixth_hurt[sixth_hurt > 1] <- 1
sixth_hurt <- sixth_hurt %>% summarise_all(sum)
hurt <- round(sixth_hurt/1876,2)
hurt6 <- hurt %>%
pivot_longer(cols = everything(), names_to = "crime", values_to = "Sixth+ Commit.") %>% arrange(desc(`Sixth+ Commit.`))
hurt_commits <- left_join(hurt_commits,hurt6, by = "crime")
write.csv(hurt_commits, "~/vizclass/Violent_Crimes.csv")
first_fraud <- left_join(charges_cats %>% filter(crime_category=='White-Collar and Fraud'),fist_timers_crimes, by = 'adjudicationcharge_descr') %>% select(-crime_category)
first_fraud <- first_fraud %>%
pivot_wider(names_from = adjudicationcharge_descr, values_from = adjudicationcharge_descr, values_fn = length, values_fill = 0) %>% select(-DCNumber)
first_fraud[first_fraud > 1] <- 1
first_fraud <- first_fraud %>% summarise_all(sum)
fraud <- round(first_fraud/1467,2)
fraud1 <- fraud %>%
pivot_longer(cols = everything(), names_to = "crime", values_to = "First Commit.") %>% arrange(desc(`First Commit.`)) %>% slice(1:10)
second_fraud <- left_join(charges_cats %>% filter(crime_category=='White-Collar and Fraud'),second_timers_crimes, by = 'adjudicationcharge_descr') %>% select(-crime_category)
second_fraud <- second_fraud %>%
pivot_wider(names_from = adjudicationcharge_descr, values_from = adjudicationcharge_descr, values_fn = length, values_fill = 0) %>% select(-DCNumber) #5970
second_fraud[second_fraud > 1] <- 1
second_fraud <- second_fraud %>% summarise_all(sum)
fraud <- round(second_fraud/782,2)
fraud2 <- fraud %>%
pivot_longer(cols = everything(), names_to = "crime", values_to = "Second Commit.") %>% arrange(desc(`Second Commit.`))
fraud_commits <- left_join(fraud1,fraud2, by = "crime")
third_fraud <- left_join(charges_cats %>% filter(crime_category=='White-Collar and Fraud'),third_timers_crimes, by = 'adjudicationcharge_descr') %>% select(-crime_category)
third_fraud <- third_fraud %>%
pivot_wider(names_from = adjudicationcharge_descr, values_from = adjudicationcharge_descr, values_fn = length, values_fill = 0) %>% select(-DCNumber) #158
third_fraud[third_fraud > 1] <- 1
third_fraud <- third_fraud %>% summarise_all(sum)
fraud <- round(third_fraud/471,2)
fraud3 <- fraud %>%
pivot_longer(cols = everything(), names_to = "crime", values_to = "Third Commit.") %>% arrange(desc(`Third Commit.`))
fraud_commits <- left_join(fraud_commits,fraud3, by = "crime")
fourth_fraud <- left_join(charges_cats %>% filter(crime_category=='White-Collar and Fraud'),fourth_timers_crimes, by = 'adjudicationcharge_descr') %>% select(-crime_category)
fourth_fraud <- fourth_fraud %>%
pivot_wider(names_from = adjudicationcharge_descr, values_from = adjudicationcharge_descr, values_fn = length, values_fill = 0) %>% select(-DCNumber) #59
fourth_fraud[fourth_fraud > 1] <- 1
fourth_fraud <- fourth_fraud %>% summarise_all(sum)
fraud <- round(fourth_fraud/271,2)
fraud4 <- fraud %>%
pivot_longer(cols = everything(), names_to = "crime", values_to = "Fourth Commit.") %>% arrange(desc(`Fourth Commit.`))
fraud_commits <- left_join(fraud_commits,fraud4, by = "crime")
fifth_fraud <- left_join(charges_cats %>% filter(crime_category=='White-Collar and Fraud'),fifth_timers_crimes, by = 'adjudicationcharge_descr') %>% select(-crime_category)
fifth_fraud <- fifth_fraud %>%
pivot_wider(names_from = adjudicationcharge_descr, values_from = adjudicationcharge_descr, values_fn = length, values_fill = 0) %>% select(-DCNumber) #32
fifth_fraud[fifth_fraud > 1] <- 1
fifth_fraud <- fifth_fraud %>% summarise_all(sum)
fraud <- round(fifth_fraud/165,2)
fraud5 <- fraud %>%
pivot_longer(cols = everything(), names_to = "crime", values_to = "Fifth Commit.") %>% arrange(desc(`Fifth Commit.`))
fraud_commits <- left_join(fraud_commits,fraud5, by = "crime")
sixth_fraud <- left_join(charges_cats %>% filter(crime_category=='White-Collar and Fraud'),six_or_more_timers_crimes, by = 'adjudicationcharge_descr') %>% select(-crime_category)
sixth_fraud <- sixth_fraud %>%
pivot_wider(names_from = adjudicationcharge_descr, values_from = adjudicationcharge_descr, values_fn = length, values_fill = 0) %>% select(-DCNumber) #27
sixth_fraud[sixth_fraud > 1] <- 1
sixth_fraud <- sixth_fraud %>% summarise_all(sum)
fraud <- round(sixth_fraud/189,2)
fraud6 <- fraud %>%
pivot_longer(cols = everything(), names_to = "crime", values_to = "Sixth+ Commit.") %>% arrange(desc(`Sixth+ Commit.`))
fraud_commits <- left_join(fraud_commits,fraud6, by = "crime")
write.csv(fraud_commits, "~/vizclass/White-Collar_and_Fraud.csv")
Unfortunately, it does not appear to be possible to embed a D3 dynamic visual within a Distill website. Please click the link to view the visual. Interactive Viz