I am setting up my variable to hold the filtered dates of when there are suspicious phone calls through the 2007 year. However, something is fishy with setting the Date format in the Date column.
I've tried without format, moving the %m/%d/%Y to %Y/%m/%d, I've tried switching from 01/01/2007 to 2007/01/01 as well as the 01-01-2007.
SFPD_reports <- read_csv("SFPD_Incident_Reports_2003_May2018.csv")
SetDate_SetCrime <- Create_Fil_Sus %>%
mutate(Date = format(as.Date(Date, "%m/%d/%Y")))
SetDate_SetCrime <- select(Create_Fil_Sus, IncidntNum, Descript, DayOfWeek, Date, Location)%>%
filter(Date >= (as.Date("01/01/2006", "%m/%d/%Y") & (Date <= as.Date("12/31/2007", "%m/%d/%Y"),
Descript == "SUSPICIOUS PERSON"))%>%
mutate(lat= (str_sub(Location, 26, str_length(Location))),
lon= (str_sub(Location, 9, 24)))
But I get:
Error in charToDate(x) : character string is not in a standard unambiguous format