**I have** data on results of surgical operations:

 - date of operation (in YYYY-MM-DD format)
 - result of operation (0 for successful operation, 1 for unsuccessful operation) 

Date is usually used only for case ordering. 
**I need to** 

 - plot a learning curve. (I had found that the resulting curve called **cumulative average**.) x should be the number of cases y - probability of failure (usually decreases).
 - get the data on current performance quality 

**The question is:**

 - What is the way to achieve this in R (with ggplot2 if possible)?

 - Is $\dfrac{successful}{total}*100\%$ will be sufficient statistic for this case or something more advanced is usually required?