I have a time series data that can plot using:
plot(x$numbers, type="l", col="blue")
I like to get the 95th percentile and add this 95th percentile to this graph
x_percent<-quantile(x$numbers, 0.95)
How do I add x_percent to the existing graph of x$numbers?
x$numbers<-c(1,2,3,8,10,30)
x$percent<-quantile(x$numbers, 0.95)
plot(x$numbers, type="l")
here, I like to add the x$percent to the graph, basically draw a vertical line with the value of 95th percentile value.
andy ideas?
Ok your edit didnt help much but I am guessing you’re wanting to do something like this..(see Justins comments)
But your mention of time series makes me think you’re not sure what you’re plotting. Otherwise you would be simply marking the
ablineon a particular date.PS I’m guessing you do want the line on the other side of the x axis