I am playing around with the Los Angeles Police Data that I got via the Office of the Mayor's website. From 2017-2018, I am attempting to see what charges and the amount of each specific charge were given out in Council District 5. CHARGE
and CITY_COUNCIL_DIST
are the two variables/columns I am looking at.
I used table(ArrestData$CHARGE)
to count the number of distinct values.
I realized that there are over 2400 unique entries, therefore most of the entries are being omitted. I am wondering if there is code to see which 5 "CHARGES" are being mostly given out by the LAPD.
Additionally, I am attempting to find the top 5 charges in one specific Council District
(again, another variable/column), is there code for this?
Aside:
How can I add sample data to my post? What are the steps to do so on RStudio?
Someone asked me to do this in a previous post, but I am not sure how to do so. They told me to use dput(head(df,n))
but my data is too large, even with using 10 rows. They told me to do it through RScript, but I am not sure what they mean