Indexing is the key. You can table two variables according to the criteria that you need. Consider these data:
dt <- data.frame(gender = rep(c("Male", "Female"), c(4, 2) ), trans = rep(c("Car", "Bus", "Bike"), c(3, 2, 1) ))
table(dt)
trans
gender Bike Bus Car
Female 1 1 0
Male 0 1 3
By adjusting the arguments of dt$colname
, you can get a finer control over the final output. I think this is the point that requires attention. Here I want only the people using the car.
table(dt$gender[dt$trans=="Car"])
Female Male
0 3
For your case, hence, try to handle the problem with indexing.
Instead of
prop.test(table(CRDATA$Year,CRDATA$Arrest)),
try
prop.test(table(CRDATA$Year[CRDATA$Arrest == "FALSE"]))