title: How to divide 2D data into two groups
body: <p>I have <code>Test</code> data as below;</p>
  
  <pre><code>Test
             x        y
  1  4324.3329 484.6496
  3  3258.4572 499.9621
  4  4462.8230 562.7703
  7  5173.4353 572.9492
  8  4188.0244 530.8349
  9  3557.5385 494.6672
  10 2353.1382 517.5235
  11 4944.2605 537.7489
  15 3335.6628 488.4479
  16 4059.0555 534.5479
  17 4694.1778 531.7709
  18 3213.8639 496.0062
  19 4119.5348 516.3399
  20 4267.7457 537.1041
  22 4284.2706 503.8527
  23 3019.6271 498.8519
  35 2549.8743 503.5473
  36 4976.5386 566.5985
  37 2717.9942 513.2320
  38 3545.2092 448.4752
  40 3352.3206 457.7265
  41 3198.0481 560.4075
  42 1387.7531 395.7657
  43  957.6421 296.1419
  44 3168.8167 489.5333
  45 2717.1015 478.6760
  46 3694.8913 455.2763
  47 4131.9760 519.9161
  48 4366.2339 502.5977
  49 4314.1003 486.7103
  50 3818.1977 461.5844
  52 3745.0532 467.7885
  </code></pre>
  
  <p>I add scatter plot as follows;</p>
  
  <pre><code>gg &lt;- ggplot(Test, aes(x = x, y = y))+
    geom_point()+
    stat_ellipse()
  ggMarginal(
    gg,
    type = "boxplot",
    margins = "both",
    size = 5
  )
  print(gg)
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/Yh4bO.png" alt="enter image description here"></p>
  
  <p>It seems like there are two groups; </p>
  
  <p>(1) at right-top with large number of points</p>
  
  <p>(2) at left-bottom with two points.</p>
  
  <p>In this case, how can I divide the data into two groups?</p>
  
  <p>I have tried k-mean clustering as follows;</p>
  
  <pre><code>#k-mean
  km &lt;- kmeans(Test,2)
  library(cluster)
  clusplot(Test, km$cluster, color=TRUE, shade=TRUE, labels=2, lines=0)
  </code></pre>
  
  <p>But, this changes x-y coordinates into PC1 &amp; PC2, which is not what I want in this case.</p>
  
  <p><img src="https://i.stack.imgur.com/X17vE.png" alt="enter image description here"></p>