I guess you need a barplot:
x <- data.frame(n_vehicles = c(10, 20, 30, 40),
time_interval = c(2, 5, 4, 9))
barplot(height = x$time_interval,
names.arg = x$n_vehicles)
Or alternatively:
plot(x = x$n_vehicles,
y = x$time_interval,
type = "h")
The "h"
stands for "histogram".
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…