title: R draw multiple models in one plot
body: <p>I have done multiple survival models using kaplan-Meir approach, each survival model was built by extracting sub set of data to different R Data table based on group column showed in the data table. I can plot each survival curve separate but I want to plot all these different models in one plot. what is the best way to do that. </p>
  
  <pre><code> userid        lifespan_days              event        group
  2                    4657                    1           A
  4                    4658                    1           A
  16                   1106                    1           A
  50                    458                    1           A
  51                   4393                    1           A
  57                    305                    1           A
  </code></pre>
  
  <p>It would be great to do this in ggplot, By search I found following <a href="https://stackoverflow.com/questions/13294445/ggplot2-plot-multiple-models-on-the-same-plot"><code>ggplot2</code> - plot multiple models on the same plot</a> but I have problem of doing such scenario due to the nature of my data. For example <code>userid</code> is from multiple websites so <code>userid=2</code> can exist under another group.</p>
  
  <p>Lets say using above data.table I have created following:</p>
  
  <pre><code>a_time &lt;- dt$lifespan_days
  a_event &lt;- dt$event
  survival_model_a &lt;- survfit(Surv(a_time, a_event) ~ 1)
  plot(survival_model_a)
  </code></pre>
  
  <p>this will only plot one similary in the same plot I want to plot the model that I built for group b data which is in a different <code>data.table / data.frame</code></p>