Pingping
08/24/2020
The Safe Distance app could predict the safe ditance at different input speed, and display the output using interactive plots.
plot(x= cars$speed, y = cars$dist, col = 'darkgray')
lmfit <- lm(cars$dist~cars$speed)
abline(lmfit, lwd = 2, col = "red")
abline(v = 10, lwd = 2, col = "grey")
abline(h = max(as.vector(cars[cars$speed == 10, ]$dist)), col = "blue")
abline(h = lmfit$coefficients[[1]]+10*lmfit$coefficients[[2]], col = "green")