title: In ggplot2, how to draw mean points for scatters and connect these mean points?
body: <pre><code>require(ggplot2)
  F1 &lt;- c(915.6425,776.2108,786.5994,656.7274,790.5350,949.0578,1053.3216,971.0848,863.6778,738.1062,
      884.1085,904.4734,872.4323,749.6835,736.6229,773.6344,816.7553,858.8569,853.3249,891.7048,
      850.5705,754.4007,354.7462,343.2167,337.7637,330.5004,309.0369,318.4770,335.2704,346.9049,
      422.9287,385.5191,410.3909,416.1298,423.8248,353.9624,264.2674,199.2254,342.5222,319.3892,
      325.5104,293.2321,289.0946,294.4882,307.3506,295.4908,344.1240,326.8981,326.8264,356.7491,
      362.6374,459.3103,431.8374,436.6566,433.1298,430.9657,419.5703,494.0244,370.0444,439.8624,
      296.8736,546.3018,311.0276,330.3982,346.5127,292.0111,392.9396,336.4151,310.8202)
  
  F2 &lt;- c (1708.907,1703.188,1763.067,1757.835,1768.614,1651.012,1550.874,1593.289,1641.620,1238.515,1674.767,
       1679.122,1638.291,1213.908,1793.527,1948.038,1782.379,1665.103,1646.012,1412.545,1746.250,1924.981,
       2715.633,2593.596,2657.560,2609.197,2553.094,2712.059,2688.420,2668.596,2574.913,2576.952,2615.174,
       2570.738,2520.431,2635.001,2726.716,2491.044,2638.541,2741.096,2708.415,2661.317,2725.348,2684.339,
       2644.370,2724.902,2574.692,1092.502,1154.349,1698.169,1753.618,1138.324,1200.801,1592.622,1788.171,
       1668.637,1442.751,1587.081,1871.528,1783.440,1429.906,1606.038,1318.925,1623.297,1452.331,1822.482,
       1972.793,2017.814,1291.637)
  
  register&lt;-c("ADS","ADS","ADS","ADS","ADS","ADS","ClearSpeech","ClearSpeech","ClearSpeech","ClearSpeech","ClearSpeech","ClearSpeech","ClearSpeech","IDS","IDS","IDS","IDS","IDS","IDS","IDS","IDS","IDS","ADS","ADS","ADS","ADS","ADS","ADS","ADS","ClearSpeech","ClearSpeech","ClearSpeech","ClearSpeech","ClearSpeech","ClearSpeech","ClearSpeech","IDS","IDS","IDS","IDS","IDS","IDS","IDS","IDS","IDS","IDS","IDS","ADS","ADS","ADS","ADS","ClearSpeech","ClearSpeech","ClearSpeech","ClearSpeech","ClearSpeech","ClearSpeech","ClearSpeech","ClearSpeech","ClearSpeech","IDS","IDS","IDS","IDS","IDS","IDS","IDS","IDS","IDS")
  
  
  syllable &lt;- c ("a2", "a2", "a2", "a2", "a2", "a2", "a2", "a2", "a2", "a2", "a2", "a2", "a2", "a2", "a2", "a2", "a2", "a2", "a2", "a2", "a2", "a2", "i2", "i2", "i2", "i2", "i2", "i2", "i2", "i2", "i2", "i2", "i2", "i2", "i2", "i2", "i2", "i2", "i2", "i2", "i2", "i2", "i2", "i2", "i2", "i2", "i2", "u2", "u2", "u2", "u2", "u2", "u2", "u2", "u2", "u2", "u2", "u2", "u2", "u2", "u2", "u2", "u2", "u2", "u2", "u2", "u2", "u2", "u2")
  
  data2 &lt;- cbind(syllable, register, F1, F2)
  data2 &lt;- as.data.frame(data2)
  
  
  p&lt;-ggplot (data2, aes (x = F1, y = F2, shape = syllable, color = register))+
     geom_point(aes (color = register))
  
  p
  </code></pre>
  
  <p>This is my data. These points are classified by two factors: syllable and register. </p>
  
  <p>How to do achieve this: within each level of the "register" factor, I want to draw three points show an averaged point for the three syllables "a2", "i2" and "u2" respectively, and connect the three points by a triangle. So there should be three triangles for three registers respectively. Like this:</p>
  
  <p><a href="https://i.stack.imgur.com/Kd5eT.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Kd5eT.jpg" alt="enter image description here"></a></p>