I am dealing with a dataset of crimes and want to determine the peak time for a crime. I have successfully created a vector of POSIXct types (e.g., "2017-01-01 00:00:00 EST") but can only map all the dates using hist.POSIXt.
To clarify, I would like to plot a histogram where the x-axis is a 24-hr period broken down into bins of 15 minutes, where I plot all of my data, regardless of the date on which the crime occurred.
I am using the dataset here: https://data.somervillema.gov/Public-Safety/Police-Selected-Criminal-Incidents/4jey-jqxb
My code to create the vector:
df<-read.csv("Police_-_Selected_Criminal_Incidents.csv", stringsAsFactors = FALSE)
date_reported<-as.POSIXct(strptime(df$dtreported,"%m/%d/%Y %r"))