Does the junction detail number tell you whether it was a junction or roundabout? I would be unterested to know how many are at junctions and roundabouts. How much was a driver pulling out in front of a cyclist. Plus how many are during what you might call rush hour and how many are at night?
Junction detail codes:
0 Not at or within 20 metres of junction
1 Approaching junction or waiting/parked at junction approach
2 Cleared junction or waiting/parked at junction exit
3 Leaving roundabout
4 Entering roundabout
5 Leaving main road
6 Entering main road
7 Entering from slip road
8 Mid Junction - on roundabout or on main road
-1 Data missing or out of range
How many are at junctions and roundabouts? 12443 at any sort of junctions and about 7000 at roundabouts. I think I cannot be exact about roundabouts because code 8 covers roundabouts and other junctions.
> nrow(cycle_accidents)
[1] 17820
> nrow(subset(cycle_accidents,!Junction_Detail==0&!Junction_Detail==-1))
[1] 12443
> nrow(subset(cycle_accidents,is.element(Junction_Detail,c(3,4))))
[1] 6640
> nrow(subset(cycle_accidents,is.element(Junction_Detail,c(3,4,8))))
[1] 7181
How much was a driver pulling out in front of a cyclist? Well, there were 685 cyclist-injuring collisions entering junctions where the first vehicle was a car with first point of impact on the offside or nearside. Far more collisions involved a side of a car at a junction exit, totalling 2339 collisions (same calculation with junction detail codes 4,6,7 replaced with 2,3,5). Switching to first point of impact on the front of the car, there were 991 collisions on entry and 3687 on exit.
Stepping outside the numbers for a moment to comment: this sort of makes sense to me because cyclists can see drivers better at entries and brake or avoid more easily, whereas at exits, cars tend to be coming from behind and collisions can be from left-hooking or shunting which are more difficult to avoid.
> indexes_of_interest <- subset(cycle_accidents,is.element(Junction_Detail,c(4,6,7)),select=Accident_Index)
> nrow(subset(Vehicles,Vehicle_Reference=="1"&is.element(Accident_Index,indexes_of_interest$Accident_Index)&is.element(X1st_Point_of_Impact,c(3,4))))
[1] 685
How many are during what you might call rush hour? 6155
> cycle_accidents_weekday <- subset(cycle_accidents,!is.element(Day_of_Week,c(1,7)))
> nrow(cycle_accidents_weekday)
[1] 14385
> nrow(subset(cycle_accidents_weekday,grepl("(0[678]:|16:[345]|17:|18:[012])",Time)))
[1] 6155
How many are at night? 3719 incidents had a light code for some sort of darkness.
> nrow(subset(cycle_accidents,is.element(Light_Conditions,c(4,5,6,7))))
[1] 3719
What does all that tell us?