title: How to make a spaghetti plot in R?
body: <p>I have the following:
  heads(dataframe):</p>
  
  <pre><code>ID Result Days 
  
  1   70     0         
  1   80     23
  2   90     15
  2   89     30
  2   99     40
  3   23     24
  </code></pre>
  
  <p>ect...
  what I am trying to do is: Create a spaghetti plot with the above datast. What I use is this: </p>
  
  <p><code>interaction.plot(dataframe$Days,dataframe$ID,dataframe$Result,xlab="Time",ylab="Results",legend=F)</code> but none of the patient lines are continuous even when they were supposed to be a long line.</p>
  
  <p>Also I want to convert the above dataframe to something like this: 
  ID Result Days </p>
  
  <pre><code>1   70     0         
  1   80     23
  2   90     0
  2   89     15
  2   99     25
  3   23     0
  </code></pre>
  
  <p>ect... ( I am trying to take the first (or minimum) of each id and have their dating starting from zero and up). Also in the spaghetti plot i want all patients to have the same color IF a condition in met, and another color if the condition is not met. </p>
  
  <p>Thank you for your time and patience.</p>