# Calculate probability of event from ecdf in R

I'm using R and would like to calculate the probability of an event happening. I used the ecdf function on daily revenue (month-to-date).

I have a target and a daily number necessary to hit target and I want to calculate based upon historical performance, the probability of hitting target.

Say my g= ecdf(x). Would g(daily target)-g(median performance) give me the probability that I am looking for?

Define $f(x)$ as the ecdf of $x,$ that is, the probability of observing a value less than or equal to $x$. What you want is probably $1-f(\text{target})$, the probability of observing a value larger than the target. Note that this makes some strong assumptions, like that each day is an iid random variable. If there's some kind of seasonal or day-of-week effect, your model won't be a great representation of reality.