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”.