I was wondering if there is any package in R that could use x, y coordinates and shape sizes to draw something like this:
I have the coordinates of vehicles' front centers and their sizes (length and width).
Edit
This is what the original data set looks like:
> head(df)
Vehicle.ID Frame.ID Global.X Global.Y Vehicle.Length Vehicle.width Lane Preceding.Vehicle.ID Following.Vehicle.ID Spacing Headway
1 2 43 6451214 1873261 14.5 4.9 2 0 13 0 0
2 2 44 6451217 1873258 14.5 4.9 2 0 13 0 0
3 2 45 6451220 1873256 14.5 4.9 2 0 13 0 0
4 2 46 6451223 1873253 14.5 4.9 2 0 13 0 0
5 2 47 6451225 1873250 14.5 4.9 2 0 13 0 0
6 2 48 6451228 1873247 14.5 4.9 2 0 13 0 0
For any given frame, I want to visualize the gaps, e.g., for frame no. 500:
ff <- subset(df, Frame.ID==500)
qplot(x=Global.X, y=Global.Y, data=ff)
All these dots are the front center coordinates of vehicles. I don't know how to display the length and width of each vehicle and label the gap values.