I am trying to use the aggregate command in R with the data "crime." However I keep getting this error when I try to execute the command:
Error in FUN(X[[i]], ...) : object 'n' not found
My code is as follows:
crime<-read.csv("Crime_Reports.csv")
larcperneighborhood<-aggregate(crime, by=list(Larceny,Neighborhood), FUN = sum)
Error in FUN(X[[i]], ...) : object 'n' not found
vcoccurance<-aggregate(crime, by=list(DOJ.Violent.Crime,Neighborhood), FUN = sum)
Error in FUN(X[[i]], ...) : object 'n' not found
theftperneighborhood<-aggregate(crime, by=list(Theft,Neighborhood), FUN = sum)
Error in FUN(X[[i]], ...) : object 'n' not found
felperneighborhood<-aggregate(crime, by=list(Felony,Neighborhood), FUN = sum)
Error in FUN(X[[i]], ...) : object 'n' not found
I'm not sure what the next step is, I cannot find an 'n' in my data. Thank you!