title: How to compute the mean survival time
body: <p>I'm using the <code>survival</code> library. After computing the Kaplan-Meier estimator of a survival function:</p>
  
  <pre><code>km = survfit(Surv(time, flag) ~ 1)
  </code></pre>
  
  <p>I know how to compute percentiles:</p>
  
  <pre><code>quantile(km, probs = c(0.05,0.25,0.5,0.75,0.95))
  </code></pre>
  
  <p>But, how do I compute the mean survival time?</p>