This code was working and now I keep getting the error...Error in xy.coords(x, y, xlabel, ylabel, log) : 'x' and 'y' lengths differ
xvals <- seq(from = -4*sigma, to = 4*sigma, length.out = 100)
ndens <- dnorm(xvals, mean = mu, sd = sigma)
plot(xvals, ndens, type = "l")
VaR99 <- qnorm(0.99, mean = mu, sd = sigma)
ES99 <- ESnorm(0.99, mu = mu, sd = sigma)
abline(v = VaR99, col = "red")
abline(v = ES99, col = "green")