title: How to plot a line connecting geom_points for repeated measures in R?
body: <p>I'm looking for a way to connect my individual datapoints in my ggplot, so show that the data is a repeated measure of the same individual over time. Until now, I've managed to create a barplot with the individual geom_point (datapoint per subject) on top. I would however like to connect the dots matching to the same participant between the three timepoints. 
  Any pointers? </p>
  
  <pre><code>  ## Example data, data from two groups: patients and controls
      data_ex &lt;- data.frame( pnum = c(1,2,3,4,5,6,7,8,9,10),
                                 group = c("patient", "patient","patient","patient","patient","control","control","control", "control", "control"),
                                 age = c(24,35,43,34,55,24,36,43,34,54),
                                 panas_1.1 = c(-26, -15, -17, -15, -20, -21, -18, -19, -16, -20),
                                 panas_1.2 = c(-25, -19, -14, -18, -20, -22, -17, -19, -18, -19),
                                 panas_1.3 = c(-22, -21, -18, -14, -21, -21, -14, -17, -16, -18))
  
      ## Reshape the data
          data_ex_long &lt;- data_ex %&gt;% gather(key = time, value = PANAS_score, panas_1.1, panas_1.2, panas_1.3)
  
      ## plot the data
          ggplot(data=data_ex_long,aes(x = time, y = PANAS_score, fill = group)) +  
              geom_bar(stat = "summary",fun.y = 'mean', colour="black", size=1.8, position = position_dodge(width = 1)) +
            geom_point(aes(time, fill = group), colour="black", size = 3, shape = 21, position = 
                         position_jitterdodge(jitter.width = 0.2, jitter.height=0.4, 
                                              dodge.width=0.9), alpha = 0.8) +
            geom_errorbar(aes(size=2),stat = 'summary', position = 'dodge', color = "black", width = 1, size = 1, fatten = 2) +
            theme(text = element_text(size = 18),
                  legend.position = "none",
                  axis.text.x  = element_text(size=15, color="#000000"),     
                  axis.text.y  = element_text(size=20, color="#000000"),       
                  axis.title.x = element_blank(),  
                  axis.title.y = element_text(size=18, color="#000000"),
                  axis.line.x  = element_line(colour = "black", size = 1.3), 
                  axis.line.y  = element_line(colour = "black", size = 1.3),
                  panel.border = element_blank(),
                  panel.grid.major = element_blank(), panel.grid.minor = element_blank(),
                  panel.grid.minor.x = element_blank(), panel.grid.major.x = element_blank(),
                  panel.background = element_blank(),
                  axis.ticks.length = unit(.25, "cm"),
                  axis.line = element_line()) +
            ylab(" PANAS score ") + 
            NULL
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/lOO3T.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/lOO3T.png" alt="enter image description here"></a></p>