title: Connecting points with geom_line in a specific order
body: <p>I am trying to use ggplot to connect the points according to a factor. However, the trajectory follows the x-axis instead. What should I do to adjust that?</p>
  
  <pre><code>dput(TimeEff)
  structure(list(Treat = c("N0", "N0", "N0", "N0+P", "N0+P", "N0+P", 
  "N60", "N60", "N60", "N60+P", "N60+P", "N60+P", "N60+P+V", "N60+P+V", 
  "N60+P+V", "N60+V", "N60+V", "N60+V"), Time = c("T157", "T217", 
  "T7", "T157", "T217", "T7", "T157", "T217", "T7", "T157", "T217", 
  "T7", "T157", "T217", "T7", "T157", "T217", "T7"), RS1 = c(-1.01597331415296, 
  0.054728432606514, 1.23431053133827, -1.19280356432481, 1.61496198976957, 
  0.636003270299734, -0.342528948667479, 0.194284721950614, 0.752617571838938, 
  -0.0439584997550503, 0.369429998745985, -0.76081828888195, 1.12724878948647, 
  -0.516440867545781, -1.70338001868143, 1.46801553741383, -1.7169642755269, 
  -0.158733065913559), RS2 = c(1.75027373091837, -0.6927999472494, 
  1.35360298097727, -1.63875683201727, 1.49686318476304, 0.472748817213433, 
  0.324463226953492, -1.27828027422272, -1.38449342877724, -0.346570122181144, 
  -0.587114634280834, -0.862512307254707, -0.14870885455771, -0.0765871299220654, 
  0.983322157621319, 0.0592988508842657, 1.13791880091197, -0.56266821978008
  )), class = "data.frame", row.names = c(NA, -18L))
  </code></pre>
  
  <p>This is the ggplot function:</p>
  
  <pre><code>TimeEff %&gt;%
    mutate(Time = factor(Time, levels = c("T7", "T157", "T217"))) %&gt;% 
    ggplot(aes(x = RS1, y = RS2, color = Treat))+
    geom_point(size=4)+
    geom_text(aes(label=Time),hjust=0, vjust=0)+
    geom_line(arrow = arrow(type = "closed"),size=1)
  </code></pre>
  
  <p>I would like that the line follow the direction T7 -> T157 -> T217 for each of the groups. What should I change to solve that?</p>
  
  <p><a href="https://i.stack.imgur.com/hUaGk.jpg" rel="nofollow noreferrer">Resulting plot</a></p>