将函数应用于按cut()分组的数据

时间:2012-07-31 15:30:27

标签: r

我想帮助使用cut总结数据。我在不太复杂的情况下取得了成功,但现在我被卡住了。

数据:

> dput(sumsq)
structure(list(part_no = c(10L, 10L, 10L, 10L, 10L, 10L, 10L, 
10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 
10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 
10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 
10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 
10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 
10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 
10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 
10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 
10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 
10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 
10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 
3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 
3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 
3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 
3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 
3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 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0.8, 
0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 
0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 
0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 
0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 
0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 
0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 
0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 
0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 
0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0, 0, 0, 0, 
0, 0, 75.6, 0, 89.6, 24.8, -100, -100, 75.6, 100, 100, -100, 
-100, -100, -100, -100, -100, 75.6, 98.4, 98.4, -51.2, -51.2, 
0.8, 0.8, 0.4, 0.4, 0.4, 0.4, 75.2, -100, -100, -100, 1.2, -0.4, 
-0.4, -0.4, -0.4, 100, 100, -1.6, 0, 0, 0, 0, -100, 0.4, 100, 
0.4, 0.4, 100, -0.4, -78.4, 0.4, 100, 100, 100, 100, -100, 23.6, 
61.2, 61.2, 69.2, 75.6, 75.6, 75.6, 75.6, 75.6, 98, 98, 98, -75.2, 
-75.2, 47.2, 47.2, 47.2, 47.2, 76.8, 97.6, -71.6, -71.6, -71.6, 
-71.6, 24, 52, 52, 52, 75.2, 75.2, -77.6, 25.2, 47.2, 76.4, 76.4, 
76.4, 76.4, 76.4, 76.4, 76.4, 76.4, 76.4, 76.4, 76.4, 76.4, 76.4, 
76.4, -73.2, -73.2, -73.2, -73.2, 0.8, 0.8, 75.2, 75.2, 75.2, 
75.2, 75.2, 75.2, 0.4, 0.4, 0.4, 0.4, 0.4, -100, -100, -100, 
-100, -100, 73.2, 2, -0.8, -0.8, -0.8, -100, -0.4, -0.4, 50.4, 
50.4, 50.4, 50.4, 50.4, 50.4, -76.4, 99.6, 99.6, -76.4, 100, 
100, 50.4, 1.2, 28, -1.2, 93.6, 41.2, 1.6, 24.8, -1.6, 0, 0, 
24.8, -24, 26, 50.8, 2, 28, 36.4, 24, -43.6, 33.6, 61.2, 81.2, 
86.8, 34, -51.6, -2, 28.4, 2, 82, 41.6, 25.6, 82, 0.8, 92, 1.2, 
86.4, 54, 96, 0.4, -54.4, 1.2, -93.2, -49.2, -98.4, -2, -77.2, 
93.2, 23.6, 78.8, 42.4, 0.4, 2.8, 70.8, 24.4, 2.4, 62, 92.8, 
16.4, -61.2, 24.4, -77.2, -0.4, 74.8, 3.6, 82, 82, 18, 54, 9.2, 
55.2, 96.4, 96.4, 90, 90, -84.4, -84.4, -2.8, -2, -90.4, 2.4, 
34.8, 24, -1.6, -16.8, 2.8, 2.4, -83.2, 22.4, 22.4, -1.6, -1.6, 
60, -2.4, 2.4, 2, 0.8, -22.8, 2, -1.6, 25.2, 2, 2, -52.8, -1.2, 
-1.2, 3.2, -74.4, 3.2, 3.2, -78.4, 0.4, -2.4, 0.4, 0.4, 0.4, 
0.4, 0.4, 0.4, -79.2, -0.8, -0.8, -0.8, -0.8, -0.8, -3.2, 41.2, 
-0.8, -0.8, -0.8, -0.8, -83.2, -1.6, -1.6, 0.4, 0.4, 0.4, -90, 
-1.6, -1.6, -1.6, -1.6, -1.6, -1.6, -1.6, -1.6, -1.6, -1.6, -1.6, 
77.6, -79.6, 80.8, -81.6, -93.2, -100, 8.4, 75.6, 82.8, 67.2, 
-27.2, 78.8, 65.6, 84.8, 73.6, 46.8, -62.4, 57.2, 74, 13.6, -0.8, 
32.8, -27.2, 6.4, -67.2, 79.2, -64, 58, -40.4, 64, 8, 60, 76.8, 
-24.8, -52.4, 56.8, 75.6, 38.4, -50.4, -72.8, -83.6, 24, 34.8, 
54.4, -54, 67.6, 78.4, -41.6, -64.4, -83.6, -93.6, 76.8, -2.4, 
-19.2, -54, -38, 5.2, 52.4, 64.8, 42.4, 77.6, -46.4, -74.8, -60.4, 
-83.2, -56.4, -34.8, -16.8, 21.2, 40, 59.2, 0.4, -17.6, 24.4, 
-14.4, 35.2, -26.8, 42, 44, -1.2, -35.6, 10.8, -19.6, -35.2, 
22.4, -18.4, 27.6, -9.6, 43.2, -31.2, 45.2, 23.6, -16.4, 28.8, 
40.4, 25.6, -8, 15.6, 11.2, -17.2, 15.6, -17.6, 18, 24, -9.6, 
-34.8, 12.4, -17.2, 36.4, -9.2, -35.2, -19.6, 10.4, -15.6, -30.4, 
30.8, 16.4, -14.8, -26.4, -34.4, 52.8, 34.4, 55.6, 21.2, 41.2, 
52, 36.8, 50, 15.6, 36, 53.6, -22.8, 14.8, 25.2, -13.2, -18.8, 
32, 20.8, -6.8, -16.4, -27.6, 14.4, 26.8, 38, -28.4, 19.6, -23.6, 
18.4, -19.6, 11.6, 0, 0, 0, -26, -52.4, -24.4, 2, 19.6, -10.8, 
3.6, 3.6, -25.2, 28.4, 12, -11.2, 3.2, 37.2, 26, 0.8, 47.6, -17.2, 
2.4, -12, -52.4, 0.8, 28.4, -12, 36.4, 2.4, 50.4, -16, 24.4, 
-2.4, -2.4, 15.2, -1.6, -1.6, -1.6, 24.4, -36, 33.2, 1.2, 1.2, 
-48.8, -22.4, -1.2, -100, -1.6, -1.6, -26.4, 28, -47.6, 86, -1.6, 
-1.6, -1.6, -1.6, -1.6, 41.6, -16, 29.6, -14.8, 3.2, 3.2, 100, 
0.8, 0.8, 0.8, 0.8, 25.6, 24.8, -28, 0.8, -39.2, -97.6, -97.6, 
-50, 0, 0, 49.6, 0.8, 54, 25.6, -1.2, -1.2, -90.8, 4.4, 4.4, 
41.6, -40.8, -6, -6, 51.6, -8.4, 0, 0, 0, -60, 2.8, -52.4, 1.6, 
1.6, 1.6, 18.8, 24.4, -0.4, -0.4, -0.4, -0.4, -51.6, -0.4, -0.4, 
-0.4, 26, 0, 18, -42.4, -1.6, -0.4, 60.4, -2.8, -2.8, -2.8, 76, 
2.8, 2.8, -29.2, -23.2, 23.6, -26.8, 0.4, 0.4, -40.8, -3.6, -47.6, 
27.6, -2.4, -2.4, -76, -2, -2, -2, -30.8, 26.8, -4.4, -4.4, -4.4, 
3.6, -0.8, -0.8, 67.2, -1.2, -48.8, 63.2, -42, 50, 30.8, 57.6, 
-48.8, -48.8, 41.6, -39.2, -39.2, -35.6, 40, -44, -39.6, -39.6, 
-50.8, 0, -48.8, 40, -53.2, 52, -47.2, -47.2, -46, 26.4, -29.2, 
0, -46.8, -46.8, 34.8, -43.6, 0, 39.2, 0.4, -48.4, 0, -23.6, 
29.2, 29.2, -53.2, -53.2, 19.2, 46.4, 46.4, -2, 36, 2, -25.2, 
-50, -1.6, -2, 35.2, -32.8, 31.2, -43.2, 46, -28.8, -0.4, -50.4, 
0.8, -43.6, 0.4, 27.6, -37.6, -37.6, 37.6, -50, 40.8, -0.8, -50.4, 
-49.6, 45.6, 45.6, -48.8, -0.8, -54, -54, 43.2, -48.8, 46.4, 
-42.8, 54, -54.4, 34.8, 0.4, 0.4, 0.4, 0.8, -50.4, -50.8, -50.8, 
51.6, -68.8, 0.8, 52, -42, -42, 0, -56.8, -56.8, 0.8, -48, -46.4, 
-46.8, -46.8, 0.4, 0.4, 37.2, -36.8, -36.8, -0.4, -0.4, -0.4, 
-0.4, -0.4, -48.8, 0.8, 0.8, 58.8, 2, 2, 2, 2, 29.2, -50.4, 49.6, 
41.2, -39.2, 38.8, -38.8, 28, -38, 40.8, 0.8, 0.8, 0.8, 0.8, 
0.8, -51.2, 27.2, -54.8, 0.8, 0.8, -40.4, -40.4, 0, -46.8, 35.2, 
-50.4, 9.6, -0.4, -15.2, 17.6, -26.8, -14.4, 42.8, 18.8, 2.8, 
0, -33.2, -36.4, -7.6, 18.8, 34.4, 8.8, -25.6, -16.8, -10, -50.8, 
10, -11.2, -7.2, -15.2, -62.8, 27.6, -12.8, -1.2, -24.4, 18.8, 
-7.2, 37.2, 8.4, -40, -9.6, 20, -27.2, 27.2, 7.2, -31.6, -31.6, 
27.6, -1.6, -20, -20, 34.4, 18, -23.6, 28.4, -16, 15.2, -30.4, 
-9.2, -7.6, 12.4, 23.2, 15.6, 23.2, 37.2, -8.8, -21.6, -31.6, 
-23.2, 25.2, 33.2, 9.2, 34.4, 18, 5.2, -50.4, 34.8, 12.4, -13.6, 
-7.2, 6.4, 15.2, 2, 12.8, -14.4, 32.4, 15.6, 23.2, 30, -11.6, 
-34.8, 12, -24, -11.2, -41.2, 34.4, 18.8, 18.8, 12, 37.6, 10, 
35.2, -24.4, 24.8, 40.4, 52.4, 14, -41.6, 34, 43.2, -6, -28, 
24, 35.2, 26.8, -15.2, 28, 38.8, 11.6, 57.6, 28, 12, -18.8, 35.6, 
25.2, 40.4, 59.2, -58.4, 10.4, -23.6, 18, -14, 35.2, 13.6, 48.4, 
32.8, 32.8, -17.2, -11.2, 26, -24, 15.2, -66.4, 24.4, -30.4, 
39.6, 30, 53.2, 59.6, -40.4, -14, 36, 36, 41.6, 32, 57.6, 8.4, 
62, 85.6, 85.6, 84.4, 38, 63.2, 67.2, -42.8, 63.6, 95.2, 65.2, 
86.8, 87.2, 9.2, 83.2, 11.6, 83.2, 83.2, 79.6, 63.2, 88.8, -62, 
-84.8, -84.8, -86.8, -4.4, 87.2, 86, 17.2, 81.6, -60.8, -87.6, 
80, 37.2, -64.8, 86.4, 87.2, 94.4, 94, -61.6, 86.8, 86.4, 86.8, 
86, -86, 94.4, -87.6, 80, 84.8, 86.8, -64.8, 85.2, 83.2, -90.8, 
88.8, 85.6, 85.2, 87.2, 85.2, 85.6, -64, 84.8, 84.4, -90, 84.8, 
82, -83.6, 88.4, 92, 80.8, 79.6, 80.4, 78.4, 78.4, 80, 80, 79.2, 
81.2, 84.8, -78.4, 80.8, -88.8, 81.6, 81.6, -64.8, -85.6, 89.2, 
90.4, -84, 85.2, -32.8, 49.6, 83.2, 81.2, 79.2, 80, 85.6, 81.6, 
34.4, -85.6, 83.6, 82.4, 84, 81.2, 85.6, 85.6, 87.6, 84.8, 85.6, 
82.8, -86.4, -60, 36.8, -85.6, 86.4, -65.6, 81.6, -81.2, 92.8, 
-86.4, 84.8, 63.2, 36, 86.4, 86.4, 82.4, 83.2, 82.8, 82.4, 80.8, 
80.4, 80.4, -63.6, 84.8, 84.8, 68, 93.2, 88, 89.6, 33.6, 83.6, 
-67.2, 88.8, 88, 85.2, -39.6, 84.8), diffdist = c(-9L, -7L, -16L, 
-17L, -38L, 55L, -17L, -2L, -18L, -24L, -7L, 24L, -40L, -35L, 
69L, -42L, -15L, 80L, 73L, -28L, 39L, -46L, 40L, -49L, 11L, -9L, 
-6L, -50L, 71L, 23L, -69L, -1L, 8L, 37L, -29L, -16L, 25L, -8L, 
-44L, 27L, -20L, -11L, 16L, -16L, 40L, -57L, -13L, 13L, 40L, 
-7L, 51L, -19L, -2L, -9L, 22L, 35L, -13L, -20L, -4L, -64L, 0L, 
-48L, -55L, -19L, 20L, 6L, 31L, 9L, -62L, -4L, -50L, 39L, 53L, 
-22L, 33L, 58L, 62L, -37L, 5L, -5L, 36L, 35L, -9L, 16L, -42L, 
-20L, 7L, 24L, 29L, -80L, 41L, -18L, -28L, -16L, 6L, 15L, -37L, 
52L, -12L, -40L, 64L, -28L, 22L, 29L, -4L, -47L, -3L, -61L, -2L, 
21L, 3L, 9L, 35L, 73L, -20L, -8L, -53L, -19L, -11L, -6L, -56L, 
17L, -20L, -66L, -16L, -29L, 26L, -29L, 44L, 38L, 40L, 51L, 84L, 
-33L, -33L, -6L, -71L, -14L, -13L, -47L, 21L, 5L, -9L, -42L, 
-26L, 35L, 53L, 2L, -6L, 31L, -22L, -70L, -17L, 35L, -55L, 9L, 
-14L, 2L, 11L, -71L, 49L, 30L, -40L, -77L, 15L, 53L, -29L, 51L, 
68L, -5L, -24L, -75L, -60L, -27L, -43L, -5L, -3L, -31L, -22L, 
8L, -43L, 9L, -43L, -35L, 70L, -47L, -23L, 25L, -64L, 0L, -24L, 
-17L, 68L, -12L, -57L, 28L, -9L, 42L, 35L, 21L, 13L, 9L, -9L, 
-12L, 31L, -6L, -8L, -33L, 20L, -4L, -53L, 37L, -33L, 21L, 68L, 
-28L, -56L, 61L, -69L, -12L, 9L, -23L, -60L, -9L, -7L, 45L, -44L, 
-33L, 47L, -7L, 53L, -2L, -13L, -18L, 57L, -2L, 45L, 40L, -18L, 
9L, -21L, 22L, 4L, 27L, 27L, -63L, -62L, -59L, 13L, -3L, -62L, 
2L, 23L, 52L, 20L, -18L, 52L, 40L, -51L, -24L, -18L, -29L, -47L, 
-33L, 64L, -74L, -36L, 18L, -36L, 22L, 8L, -46L, 24L, 4L, -74L, 
-3L, 18L, -53L, 20L, 60L, -9L, -19L, 15L, 31L, 18L, 35L, 24L, 
11L, -40L, -64L, 33L, -31L, 8L, 58L, 41L, -33L, -53L, -35L, 2L, 
-19L, 42L, -53L, 64L, 46L, -53L, 62L, -77L, -18L, -3L, -11L, 
33L, -67L, 68L, 0L, 51L, 13L, -11L, 40L, -65L, 22L, 39L, -5L, 
76L, -44L, -35L, 15L, 0L, 13L, 7L, 6L, -51L, -44L, -20L, 20L, 
11L, -55L, -66L, -49L, 4L, -58L, -27L, 20L, -16L, 42L, -69L, 
71L, -68L, -42L, 44L, 31L, -13L, -63L, -72L, -13L, 19L, 39L, 
-13L, 71L, -53L, -33L, 67L, -42L, 14L, 39L, 33L, -13L, -19L, 
73L, -71L, -24L, 11L, 0L, -42L, -71L, -1L, -62L, -11L, -7L, 18L, 
49L, 8L, -21L, -5L, 13L, -38L, 62L, -15L, -27L, 0L, -33L, 9L, 
-40L, -57L, 60L, 73L, -24L, 0L, 22L, -37L, -46L, -27L, 27L, 0L, 
6L, 77L, -13L, 47L, 71L, -20L, 11L, 18L, 31L, 8L, 80L, -87L, 
-20L, 57L, -37L, 24L, 62L, -11L, -50L, 9L, 52L, 7L, 2L, -57L, 
-50L, 69L, 7L, -42L, -43L, -22L, 46L, 57L, 24L, 35L, 9L, -54L, 
51L, 6L, -8L, -8L, 9L, 48L, 24L, 31L, -55L, 53L, 44L, 7L, -7L, 
22L, -53L, 42L, -44L, -2L, 6L, -9L, -5L, 33L, -20L, 20L, 36L, 
39L, -16L, -25L, 44L, -28L, 4L, -4L, -47L, -87L, 6L, -38L, 51L, 
-9L, 37L, -47L, 72L, -19L, 26L, 37L, -43L, 29L, -11L, 54L, 4L, 
-41L, -24L, -55L, 11L, 35L, 22L, 57L, 61L, 40L, -52L, -17L, 10L, 
28L, -24L, -28L, -3L, -9L, -47L, 40L, 35L, 57L, 13L, 13L, 33L, 
24L, 22L, -67L, -49L, -77L, 7L, -36L, 9L, 29L, -16L, -5L, 11L, 
-13L, 57L, -17L, 49L, 66L, -55L, -33L, -6L, -29L, 5L, -62L, 80L, 
33L, 73L, 87L, -3L, 18L, 40L, 18L, 70L, 49L, 55L, 5L, -13L, 9L, 
-17L, 36L, -22L, 9L, 0L, -75L, -40L, -12L, 17L, 19L, -9L, 13L, 
-15L, -51L, 10L, -20L, 1L, 3L, 40L, 38L, 19L, 11L, 0L, 89L, -10L, 
49L, 44L, 75L, 83L, -8L, 36L, -60L, 38L, -53L, -19L, 11L, 4L, 
-53L, -51L, -11L, 71L, 20L, 7L, -33L, 37L, 3L, 49L, 22L, -57L, 
-74L, -30L, 22L, 11L, -9L, -19L, -51L, -42L, 3L, 55L, -42L, -7L, 
-19L, -53L, 32L, -73L, 11L, -9L, -31L, 20L, -5L, 55L, -26L, -22L, 
-28L, 75L, -15L, -58L, 20L, 37L, -26L, -57L, -50L, -47L, -35L, 
-20L, 22L, 1L, 28L, 0L, -38L, 24L, 40L, 22L, -33L, 34L, -28L, 
-18L, 33L, -57L, 4L, -13L, -25L, -62L, 33L, -62L, 55L, 28L, -9L, 
14L, -50L, -18L, -40L, 20L, 24L, -53L, -27L, 23L, 4L, 13L, 27L, 
-55L, -4L, 44L, 4L, -9L, -17L, -44L, -42L, 18L, -33L, -44L, 17L, 
-53L, -13L, -24L, -56L, -41L, 28L, 31L, 21L, -13L, 27L, -46L, 
-50L, -25L, 29L, -7L, -6L, -11L, -18L, 71L, -69L, -50L, -3L, 
2L, 18L, -24L, -40L, -15L, -46L, 11L, 29L, 10L, -30L, 7L, -13L, 
50L, 77L, 2L, 9L, -71L, -9L, -62L, -55L, 29L, 38L, -48L, -22L, 
-30L, 39L, -44L, 42L, -5L, -61L, 16L, 24L, -46L, 2L, 4L, -8L, 
-16L, 33L, -35L, 80L, -39L, 19L, -55L, -23L, -46L, 2L, 7L, -77L, 
-5L, 18L, -44L, -18L, -62L, -62L, -84L, 85L, 13L, 49L, 11L, 41L, 
40L, -38L, 15L, 39L, -13L, 39L, -11L, -64L, 58L, 35L, -18L, 34L, 
18L, 24L, -22L, -4L, -46L, -71L, 22L, -44L, -49L, -11L, -40L, 
-4L, 11L, -5L, 37L, -24L, -27L, -33L, 52L, -11L, 9L, -54L, 0L, 
-24L, 0L, 18L, 13L, -17L, 22L, 64L, 58L, 71L, -6L, -24L, 29L, 
-3L, -22L, -9L, 55L, -9L, -16L, -35L, 56L, 25L, -58L, -26L, -9L, 
62L, -48L, -62L, 9L, 35L, -8L, 33L, 40L, 55L, 40L, 35L, -23L, 
11L, 46L, 62L, -15L, -2L, -9L, -17L, 39L, 15L, -13L, -37L, 20L, 
-7L, -14L, 70L, 28L, -2L, 55L, -25L, 6L, -36L, 30L, 62L, 66L, 
11L, 24L, -42L, 58L, 9L, 45L, 4L, 0L, -20L, 20L, 27L, -4L, 3L, 
-40L, -2L, 2L, 10L, 8L, 20L, -24L, -39L, -13L, 20L, -45L, -76L, 
-46L, 3L, -55L, -18L, 22L, 2L, -14L, -20L, -26L, 51L, -66L, -9L, 
0L, 51L, 22L, -12L, 27L, -35L, 11L, 38L, -3L, 15L, 4L, -55L, 
44L, -55L, -46L, 6L, -46L, 22L, 22L, 46L, 20L, 35L, -11L, -20L, 
-53L, 51L, -80L, -59L, -53L, -78L, -36L, -13L, 31L, 33L, -9L, 
-26L, 31L, -14L, -16L, -15L, -53L, 9L, 65L, 3L, 44L, -42L, 45L, 
-13L, -7L, -6L, 52L, 60L, -3L, -3L, 7L, -40L, 2L, 29L, 11L, 33L, 
40L, -16L, -9L, -21L, 78L, -60L, 15L, 0L, 17L, -15L, -18L, 48L, 
26L, 31L, -53L, -9L, -3L, -1L, 64L, 7L, 44L, -38L, -23L, 13L, 
55L, 57L, -71L, -20L, 23L, -18L, 4L, 16L, -7L, 52L, 42L, 24L, 
5L, -2L, 6L, -33L, 9L, 30L, -51L, 58L, 53L, -44L, -22L, -44L, 
-75L, -60L, 46L, 14L, 13L, -5L, -7L, 69L, -18L, 53L, 52L, -62L, 
-13L, 22L, 64L, -18L, 71L, 24L, -9L, 68L, -40L, -10L, -2L, 12L, 
37L, 40L, 79L, 3L, 42L, -55L, 7L, -31L, 20L, 16L, 7L, 11L, -14L, 
70L, 24L, 3L, -57L, -14L, 51L, -19L, -62L, -16L, -2L, -68L, 4L, 
7L, -20L, 4L, -15L, 49L, -16L, 11L, 6L, 56L, -6L, 68L, 28L, 33L, 
-62L, 20L, -39L, -12L, -45L, -30L, -15L, 37L, 44L, 39L, 38L, 
46L, 33L, 2L, -3L, 29L, 44L, 2L, -57L, 37L, 42L, 20L, 5L, 53L, 
-51L, 11L, -5L, -24L, 7L, 29L, -20L, -15L, 24L, 80L, 4L, 82L, 
29L, -24L, 68L, -38L, 27L, 71L, 30L, 42L, 14L, -75L, -41L, 22L, 
46L, -72L, -53L, 78L, 54L, 22L, -55L, 57L, -1L, -54L, 80L, 68L, 
-17L, -18L, -3L, 5L, 16L, -39L, -21L, -29L, -64L, -5L, 46L, -8L, 
3L, -15L, 26L, -6L, 38L, -2L, -13L, -62L, -51L, -60L, 9L, -64L, 
51L, 31L, 36L, 0L, -35L, 29L, 22L, 31L, -2L, 14L, 73L, -17L, 
17L, -58L, 55L, 37L, -16L, 71L, 28L, 72L, -26L, 22L, 12L, 25L, 
23L, -46L, -9L, -55L, -7L, 18L, -40L, 28L, -9L, 5L, -6L, 26L, 
58L, 31L, -38L, -27L, 14L, -34L, -5L, 9L, 20L, -35L, 31L, -3L, 
-19L, -33L, 34L)), .Names = c("part_no", "ratperc", "diffdist"
), row.names = c(1L, 2L, 3L, 4L, 5L, 6L, 7L, 8L, 9L, 10L, 11L, 
12L, 13L, 14L, 15L, 16L, 17L, 18L, 19L, 20L, 21L, 22L, 23L, 24L, 
25L, 26L, 27L, 28L, 29L, 30L, 31L, 32L, 33L, 34L, 35L, 36L, 37L, 
38L, 39L, 40L, 41L, 42L, 43L, 44L, 45L, 46L, 47L, 48L, 49L, 50L, 
51L, 52L, 53L, 54L, 55L, 56L, 57L, 58L, 59L, 60L, 61L, 62L, 63L, 
64L, 65L, 66L, 67L, 68L, 69L, 70L, 71L, 72L, 73L, 74L, 75L, 76L, 
77L, 78L, 79L, 80L, 81L, 82L, 83L, 84L, 85L, 86L, 87L, 88L, 89L, 
90L, 91L, 92L, 93L, 94L, 95L, 96L, 97L, 98L, 99L, 100L, 101L, 
102L, 103L, 104L, 105L, 106L, 107L, 108L, 109L, 110L, 111L, 112L, 
113L, 114L, 115L, 116L, 117L, 118L, 119L, 120L, 121L, 122L, 123L, 
124L, 125L, 126L, 127L, 128L, 129L, 130L, 131L, 132L, 133L, 134L, 
135L, 136L, 137L, 138L, 139L, 140L, 141L, 142L, 143L, 144L, 145L, 
146L, 147L, 148L, 149L, 150L, 301L, 302L, 303L, 304L, 305L, 306L, 
307L, 308L, 309L, 310L, 311L, 312L, 313L, 314L, 315L, 316L, 317L, 
318L, 319L, 320L, 321L, 322L, 323L, 324L, 325L, 326L, 327L, 328L, 
329L, 330L, 331L, 332L, 333L, 334L, 335L, 336L, 337L, 338L, 339L, 
340L, 341L, 342L, 343L, 344L, 345L, 346L, 347L, 348L, 349L, 350L, 
351L, 352L, 353L, 354L, 355L, 356L, 357L, 358L, 359L, 360L, 361L, 
362L, 363L, 364L, 365L, 366L, 367L, 368L, 369L, 370L, 371L, 372L, 
373L, 374L, 375L, 376L, 377L, 378L, 379L, 380L, 381L, 382L, 383L, 
384L, 385L, 386L, 387L, 388L, 389L, 390L, 391L, 392L, 393L, 394L, 
395L, 396L, 397L, 398L, 399L, 400L, 401L, 402L, 403L, 404L, 405L, 
406L, 407L, 408L, 409L, 410L, 411L, 412L, 413L, 414L, 415L, 416L, 
417L, 418L, 419L, 420L, 421L, 422L, 423L, 424L, 425L, 426L, 427L, 
428L, 429L, 430L, 431L, 432L, 433L, 434L, 435L, 436L, 437L, 438L, 
439L, 440L, 441L, 442L, 443L, 444L, 445L, 446L, 447L, 448L, 449L, 
450L, 601L, 602L, 603L, 604L, 605L, 606L, 607L, 608L, 609L, 610L, 
611L, 612L, 613L, 614L, 615L, 616L, 617L, 618L, 619L, 620L, 621L, 
622L, 623L, 624L, 625L, 626L, 627L, 628L, 629L, 630L, 631L, 632L, 
633L, 634L, 635L, 636L, 637L, 638L, 639L, 640L, 641L, 642L, 643L, 
644L, 645L, 646L, 647L, 648L, 649L, 650L, 651L, 652L, 653L, 654L, 
655L, 656L, 657L, 658L, 659L, 660L, 661L, 662L, 663L, 664L, 665L, 
666L, 667L, 668L, 669L, 670L, 671L, 672L, 673L, 674L, 675L, 676L, 
677L, 678L, 679L, 680L, 681L, 682L, 683L, 684L, 685L, 686L, 687L, 
688L, 689L, 690L, 691L, 692L, 693L, 694L, 695L, 696L, 697L, 698L, 
699L, 700L, 701L, 702L, 703L, 704L, 705L, 706L, 707L, 708L, 709L, 
710L, 711L, 712L, 713L, 714L, 715L, 716L, 717L, 718L, 719L, 720L, 
721L, 722L, 723L, 724L, 725L, 726L, 727L, 728L, 729L, 730L, 731L, 
732L, 733L, 734L, 735L, 736L, 737L, 738L, 739L, 740L, 741L, 742L, 
743L, 744L, 745L, 746L, 747L, 748L, 749L, 750L, 901L, 902L, 903L, 
904L, 905L, 906L, 907L, 908L, 909L, 910L, 911L, 912L, 913L, 914L, 
915L, 916L, 917L, 918L, 919L, 920L, 921L, 922L, 923L, 924L, 925L, 
926L, 927L, 928L, 929L, 930L, 931L, 932L, 933L, 934L, 935L, 936L, 
937L, 938L, 939L, 940L, 941L, 942L, 943L, 944L, 945L, 946L, 947L, 
948L, 949L, 950L, 951L, 952L, 953L, 954L, 955L, 956L, 957L, 958L, 
959L, 960L, 961L, 962L, 963L, 964L, 965L, 966L, 967L, 968L, 969L, 
970L, 971L, 972L, 973L, 974L, 975L, 976L, 977L, 978L, 979L, 980L, 
981L, 982L, 983L, 984L, 985L, 986L, 987L, 988L, 989L, 990L, 991L, 
992L, 993L, 994L, 995L, 996L, 997L, 998L, 999L, 1000L, 1001L, 
1002L, 1003L, 1004L, 1005L, 1006L, 1007L, 1008L, 1009L, 1010L, 
1011L, 1012L, 1013L, 1014L, 1015L, 1016L, 1017L, 1018L, 1019L, 
1020L, 1021L, 1022L, 1023L, 1024L, 1025L, 1026L, 1027L, 1028L, 
1029L, 1030L, 1031L, 1032L, 1033L, 1034L, 1035L, 1036L, 1037L, 
1038L, 1039L, 1040L, 1041L, 1042L, 1043L, 1044L, 1045L, 1046L, 
1047L, 1048L, 1049L, 1050L, 1201L, 1202L, 1203L, 1204L, 1205L, 
1206L, 1207L, 1208L, 1209L, 1210L, 1211L, 1212L, 1213L, 1214L, 
1215L, 1216L, 1217L, 1218L, 1219L, 1220L, 1221L, 1222L, 1223L, 
1224L, 1225L, 1226L, 1227L, 1228L, 1229L, 1230L, 1231L, 1232L, 
1233L, 1234L, 1235L, 1236L, 1237L, 1238L, 1239L, 1240L, 1241L, 
1242L, 1243L, 1244L, 1245L, 1246L, 1247L, 1248L, 1249L, 1250L, 
1251L, 1252L, 1253L, 1254L, 1255L, 1256L, 1257L, 1258L, 1259L, 
1260L, 1261L, 1262L, 1263L, 1264L, 1265L, 1266L, 1267L, 1268L, 
1269L, 1270L, 1271L, 1272L, 1273L, 1274L, 1275L, 1276L, 1277L, 
1278L, 1279L, 1280L, 1281L, 1282L, 1283L, 1284L, 1285L, 1286L, 
1287L, 1288L, 1289L, 1290L, 1291L, 1292L, 1293L, 1294L, 1295L, 
1296L, 1297L, 1298L, 1299L, 1300L, 1301L, 1302L, 1303L, 1304L, 
1305L, 1306L, 1307L, 1308L, 1309L, 1310L, 1311L, 1312L, 1313L, 
1314L, 1315L, 1316L, 1317L, 1318L, 1319L, 1320L, 1321L, 1322L, 
1323L, 1324L, 1325L, 1326L, 1327L, 1328L, 1329L, 1330L, 1331L, 
1332L, 1333L, 1334L, 1335L, 1336L, 1337L, 1338L, 1339L, 1340L, 
1341L, 1342L, 1343L, 1344L, 1345L, 1346L, 1347L, 1348L, 1349L, 
1350L, 1501L, 1502L, 1503L, 1504L, 1505L, 1506L, 1507L, 1508L, 
1509L, 1510L, 1511L, 1512L, 1513L, 1514L, 1515L, 1516L, 1517L, 
1518L, 1519L, 1520L, 1521L, 1522L, 1523L, 1524L, 1525L, 1526L, 
1527L, 1528L, 1529L, 1530L, 1531L, 1532L, 1533L, 1534L, 1535L, 
1536L, 1537L, 1538L, 1539L, 1540L, 1541L, 1542L, 1543L, 1544L, 
1545L, 1546L, 1547L, 1548L, 1549L, 1550L, 1551L, 1552L, 1553L, 
1554L, 1555L, 1556L, 1557L, 1558L, 1559L, 1560L, 1561L, 1562L, 
1563L, 1564L, 1565L, 1566L, 1567L, 1568L, 1569L, 1570L, 1571L, 
1572L, 1573L, 1574L, 1575L, 1576L, 1577L, 1578L, 1579L, 1580L, 
1581L, 1582L, 1583L, 1584L, 1585L, 1586L, 1587L, 1588L, 1589L, 
1590L, 1591L, 1592L, 1593L, 1594L, 1595L, 1596L, 1597L, 1598L, 
1599L, 1600L, 1601L, 1602L, 1603L, 1604L, 1605L, 1606L, 1607L, 
1608L, 1609L, 1610L, 1611L, 1612L, 1613L, 1614L, 1615L, 1616L, 
1617L, 1618L, 1619L, 1620L, 1621L, 1622L, 1623L, 1624L, 1625L, 
1626L, 1627L, 1628L, 1629L, 1630L, 1631L, 1632L, 1633L, 1634L, 
1635L, 1636L, 1637L, 1638L, 1639L, 1640L, 1641L, 1642L, 1643L, 
1644L, 1645L, 1646L, 1647L, 1648L, 1649L, 1650L, 1801L, 1802L, 
1803L, 1804L, 1805L, 1806L, 1807L, 1808L, 1809L, 1810L, 1811L, 
1812L, 1813L, 1814L, 1815L, 1816L, 1817L, 1818L, 1819L, 1820L, 
1821L, 1822L, 1823L, 1824L, 1825L, 1826L, 1827L, 1828L, 1829L, 
1830L, 1831L, 1832L, 1833L, 1834L, 1835L, 1836L, 1837L, 1838L, 
1839L, 1840L, 1841L, 1842L, 1843L, 1844L, 1845L, 1846L, 1847L, 
1848L, 1849L, 1850L, 1851L, 1852L, 1853L, 1854L, 1855L, 1856L, 
1857L, 1858L, 1859L, 1860L, 1861L, 1862L, 1863L, 1864L, 1865L, 
1866L, 1867L, 1868L, 1869L, 1870L, 1871L, 1872L, 1873L, 1874L, 
1875L, 1876L, 1877L, 1878L, 1879L, 1880L, 1881L, 1882L, 1883L, 
1884L, 1885L, 1886L, 1887L, 1888L, 1889L, 1890L, 1891L, 1892L, 
1893L, 1894L, 1895L, 1896L, 1897L, 1898L, 1899L, 1900L, 1901L, 
1902L, 1903L, 1904L, 1905L, 1906L, 1907L, 1908L, 1909L, 1910L, 
1911L, 1912L, 1913L, 1914L, 1915L, 1916L, 1917L, 1918L, 1919L, 
1920L, 1921L, 1922L, 1923L, 1924L, 1925L, 1926L, 1927L, 1928L, 
1929L, 1930L, 1931L, 1932L, 1933L, 1934L, 1935L, 1936L, 1937L, 
1938L, 1939L, 1940L, 1941L, 1942L, 1943L, 1944L, 1945L, 1946L, 
1947L, 1948L, 1949L, 1950L, 2101L, 2102L, 2103L, 2104L, 2105L, 
2106L, 2107L, 2108L, 2109L, 2110L, 2111L, 2112L, 2113L, 2114L, 
2115L, 2116L, 2117L, 2118L, 2119L, 2120L, 2121L, 2122L, 2123L, 
2124L, 2125L, 2126L, 2127L, 2128L, 2129L, 2130L, 2131L, 2132L, 
2133L, 2134L, 2135L, 2136L, 2137L, 2138L, 2139L, 2140L, 2141L, 
2142L, 2143L, 2144L, 2145L, 2146L, 2147L, 2148L, 2149L, 2150L, 
2151L, 2152L, 2153L, 2154L, 2155L, 2156L, 2157L, 2158L, 2159L, 
2160L, 2161L, 2162L, 2163L, 2164L, 2165L, 2166L, 2167L, 2168L, 
2169L, 2170L, 2171L, 2172L, 2173L, 2174L, 2175L, 2176L, 2177L, 
2178L, 2179L, 2180L, 2181L, 2182L, 2183L, 2184L, 2185L, 2186L, 
2187L, 2188L, 2189L, 2190L, 2191L, 2192L, 2193L, 2194L, 2195L, 
2196L, 2197L, 2198L, 2199L, 2200L, 2201L, 2202L, 2203L, 2204L, 
2205L, 2206L, 2207L, 2208L, 2209L, 2210L, 2211L, 2212L, 2213L, 
2214L, 2215L, 2216L, 2217L, 2218L, 2219L, 2220L, 2221L, 2222L, 
2223L, 2224L, 2225L, 2226L, 2227L, 2228L, 2229L, 2230L, 2231L, 
2232L, 2233L, 2234L, 2235L, 2236L, 2237L, 2238L, 2239L, 2240L, 
2241L, 2242L, 2243L, 2244L, 2245L, 2246L, 2247L, 2248L, 2249L, 
2250L), class = "data.frame")

使用矢量:

timevec1 = as.vector(ggplot2:::breaks(sumsq$diffdist, "n", n=8))

我通常使用xtabscut汇总数据:

bb1 = data.frame(xtabs(~ratperc +cut(diffdist, timevec1 ), dat=sumsq))
colnames(bb1) = c("rating", "range", "freq", "id")

虽然这个解决方案不适合我想要的东西,但我能够使用ddply汇总每个剪切的值。

但是现在我还需要保留part_no,但我似乎无法将多个列传递给cut

问题是,有没有办法一步到位?基本上每个参与者获得每次切割的所有评级的平均值?换句话说,part_no为行,范围为列,交集为下方值的平均值。

2 个答案:

答案 0 :(得分:2)

如果您只想要part_no的每个cut(diffdist, timevec1 )#Add cut variable as new column sumsq$range <- cut(sumsq$diffdist,timevec1) #Summarise using ddply ddply(sumsq,.(part_no,range),summarise,val = mean(ratperc)) 的间隔的平均评分,我会做这样的事情:

{{1}}

答案 1 :(得分:1)

如果你想要每个参与者的平均值和每个参与者的间隔或累积均值,我没有得到。

如果你想要正常的意思,你可以用

来得到它
sapply(split(sumsq, cut(sumsq$diffdist, timevec1)), function(ss)
    sapply(split(ss$ratperc, ss$part_no), mean))

如果您想要累积,可以将其改写为

t(sapply(split(sumsq, sumsq$part_no), function(ss){
    sapply(timevec1[-1], function(tc) mean(ss$ratperc[ss$diffdist <= tc]))
}))