data(grave)
env = kd.env(grave, nsim = 19)
ci = confenv(env, level = .9)
plot(env, legend = FALSE)
lines(ci)
legend("topleft", legend = c("observed", "average", "max/min", "95% conf. bands"),
lty = c(1, 2, 1, 3), col = c("black", "red", "grey", "black"))Run the code above in your browser using DataLab