title: swimmer survival plot
body: <p>Is there an easy way to generate a swimmer plot in R? Same data as in a KM curve but with each individual survival represented as a line. Example:</p>
  
  <p><img src="https://2.bp.blogspot.com/-wFJAeGC7e-o/VPxRx3t58KI/AAAAAAAAAb0/a5-WCqkKkWY/s1600/Swimmer.png" alt=""></p>
  
  <p>I've searched stackoverflow, the R-help mailing list, and consulted Dr. Google without an obvious answer, though my search technique may be suboptimal.  Thank you!</p>
  
  <p>**** ADDENDED ****
  Apologies for not appropriately asking a question - this is my first time! Playing around, I've been able to do the following:</p>
  
  <pre><code>          OS DeathYN TreatmentGroup
  4   444 days       1              0
  5   553 days       1              0
  8   812 days       0              0
  1   844 days       0              0
  10 1071 days       0              0
  9  1147 days       0              0
  6  1349 days       0              0
  3  1375 days       0              0
  2  1384 days       0              1
  7  1687 days       0              0
  
  orderedData$GroupColor[orderedData$TreatmentGroup==0] &lt;- "yellow"
  orderedData$GroupColor[orderedData$TreatmentGroup==1] &lt;- "red"
  orderedData$YCoord &lt;- barplot(as.numeric(orderedData$OS), horiz=TRUE,  col=orderedData$GroupColor, xlim=c(0,max(orderedData$OS) + 50), xlab="Overall Survival")
  points(x=20+as.numeric(orderedData$OS), y=orderedData$YCoord,pch=62, col="green")
  legend(1000,2, c("Control", "Treatment", "still living"), col=c("yellow","red", "green"), lty=1, lwd=c(10,10,0),pch=62)
  </code></pre>
  
  <p>This gets me close enough for now, but aesthetics are not perfect.  If there is a package or a better solution someone can suggest I'd love to see it!</p>