title: R: ggsurvplot how to remove the flat line before start.time (2 year)
body: <p><a href="https://i.stack.imgur.com/t2gwB.png" rel="nofollow noreferrer">link for the ggsurvplot</a></p>
  
  <p>I have defined the start.time = 2 and xlim = c(2,10). But I don't understand why there is a flat line before 2 years. Actually there is no event_years &lt; 2. Any one can help?</p>
  
  <p>Thanks!</p>
  
  <pre><code>event_censor &lt;- c(rep(0,15), 1,0,1,1,0)  
  event_years  &lt;- c(10,10,2.37,10,5.87,10,10,10,5.80,
                    10,10,10,10,6.67,5.71,2.01,2.30,3.19,8.75,2.61)
  test.df&lt;-as.data.frame(cbind(event_censor,event_years))
  
  ggsurvplot(survfit(Surv(event_years, event_censor) ~ 1, 
                     data = test.df, start.time=2 ), 
             data = test.df,  fun = "event", xlim = c(2,10), break.x.by = 1)
  </code></pre>