I am doing a survival analysis and have produced the survival graph using
- plot function to plot the Kaplan-Meier(KA variable) estimate as y value against time. 
- lines function to plot the step lines between estimate i and i+1, for each i=1,2,.... 
The code is as follows:
plot(KA)
for( i in 1:(length(KA)-1)){
lines(c(i,i+1),c(KA[i],KA[i]))       # The horizontal step lines
lines(c(i+1,i+1),c(KA[i],KA[i+1]))   # The vertical step lines
}
Now I want to make a more beautiful survival graph using ggplot2 package.
The question is: how to add the step lines into the graph?
I'm sorry, I can not put graphs as my reputation is less than 10.
 
    