ISE 599 Homework 1 Seattle crime reports: Rename the columns to simplify the names Solved
The file crime.csv available on Blackboard contains crime reports from Seattle, WA. For each crime offense it shows the date and time information, crime category and description, the neighborhood, and police department information such as sector, beat, and precinct.
Rename the columns to simplify the names. Call the columns as ODate for occurred date, RDate for reported date, OTime for occurred time, RTime for reported time, category for Crime subcategory, Description for Primary Offense Description, while leaving other columns with no change. Ignore columns Precinct, Sector, and Beat, for this homework. Unless noted otherwise, feel free to use R base or the R libraries of your choice.
1. Find the number of neighborhoods and crime categories in the dataset.
2. Report the total number of crimes in each neighborhood. What neighborhood is most dangerous?
3. Write a pipe for the previous two questions.
4. Find the most frequent crime category in the Queen Anne neighborhood.
5. Report a two-column table comparing the number of crimes per month (from RDate). What month seems to be more dangerous?
6. Draw a lineplot of the number of crimes as a function of month (in RDate)
Use vertical barplots to compare the number of crimes by category in Seattle