根据每小时日期数据制作每月日期相关的箱图

时间:2016-05-10 08:51:44

标签: r date datetime boxplot

问题

我有两个变量一年的小时数据。我想制作一个箱线图,显示每个人的每月分布情况:

enter image description here

我希望能够在几个月之间做出选择,并在不同的月份和年份之间进行一些比较,因此我不需要一次性地绘制它们。但按月划分很重要。

以下是我的数据样本

DATE_TIME            WT_R    WT_U
2014-07-16 00:00    30.75   95.98
2014-07-16 01:00    30.77   96.05
2014-07-16 02:00    30.64   95.57
2014-07-16 03:00    30.75   95.98
2014-07-16 04:00    30.81   96.18
2014-07-16 05:00    30.98   96.81
2014-07-16 06:00    30.91   96.54
2014-07-16 07:00    30.84   96.28
2014-07-16 08:00    30.64   95.57
2014-07-16 09:00    30.78   96.08
2014-07-16 10:00    31.17   97.48
2014-07-16 11:00    31.33   98.03
2014-07-16 12:00    31.46   98.49
2014-07-16 13:00    27.02   82.64
2014-07-16 14:00    24.80   74.70
2014-07-16 15:00    26.88   82.13
2014-07-16 16:00    27.78   85.37
2014-07-16 17:00    27.74   85.22
2014-07-16 18:00    27.36   83.84
2014-07-16 19:00    27.62   84.78
2014-07-16 20:00    28.17   86.74
2014-07-16 21:00    27.16   83.12
2014-07-16 22:00    19.65   56.30
2014-07-16 23:00    18.07   50.66
2014-07-17 00:00    16.40   44.68
2014-07-17 01:00    15.85   42.69
2014-07-17 02:00    16.01   43.29
2014-07-17 03:00    16.16   43.81
2014-07-17 04:00    16.12   43.67
2014-07-17 05:00    16.36   44.54
2014-07-17 06:00    16.62   45.48
2014-07-17 07:00    16.90   46.46
2014-07-17 08:00    17.15   47.34
2014-07-17 09:00    17.36   48.12
2014-07-17 10:00    17.54   48.75
2014-07-17 11:00    17.70   49.34
2014-07-17 12:00    17.86   49.91
2014-07-17 13:00    18.01   50.43
2014-07-17 14:00    18.18   51.04
2014-07-17 15:00    18.37   51.73
2014-07-17 16:00    18.59   52.52
2014-07-17 17:00    18.83   53.37
2014-07-17 18:00    19.09   54.29
2014-07-17 19:00    19.32   55.11
2014-07-17 20:00    19.53   55.88
2014-07-17 21:00    19.73   56.58
2014-07-17 22:00    19.91   57.21
2014-07-17 23:00    20.05   57.72
2014-07-18 00:00    20.17   58.14
2014-07-18 01:00    20.26   58.48
2014-07-18 02:00    20.36   58.83
2014-07-18 03:00    20.46   59.18
2014-07-18 04:00    20.54   59.46
2014-07-18 05:00    20.61   59.73
2014-07-18 06:00    20.67   59.94
2014-07-18 07:00    20.74   60.19
2014-07-18 08:00    20.81   60.43
2014-07-18 09:00    20.86   60.62
2014-07-18 10:00    20.91   60.80
2014-07-18 11:00    20.99   61.07
2014-07-18 12:00    21.13   61.58
2014-07-18 13:00    21.26   62.05
2014-07-18 14:00    21.42   62.62
2014-07-18 15:00    17.30   47.89
2014-07-18 16:00    8.28    15.65
2014-07-18 17:00    7.51    12.90
2014-07-18 18:00    8.46    16.31
2014-07-18 19:00    9.10    18.58
2014-07-18 20:00    9.70    20.72
2014-07-18 21:00    10.21   22.55
2014-07-18 22:00    10.65   24.11
2014-07-18 23:00    11.03   25.49
2014-07-19 00:00    11.38   26.73
2014-07-19 01:00    11.70   27.87
2014-07-19 02:00    12.00   28.95
2014-07-19 03:00    12.27   29.93
2014-07-19 04:00    12.52   30.80
2014-07-19 05:00    12.74   31.60
2014-07-19 06:00    12.95   32.34
2014-07-19 07:00    13.14   33.04
2014-07-19 08:00    13.33   33.72
2014-07-19 09:00    13.50   34.32
2014-07-19 10:00    13.67   34.93
2014-07-19 11:00    13.87   35.62
2014-07-19 12:00    14.07   36.33
2014-07-19 13:00    14.28   37.10
2014-07-19 14:00    14.50   37.90
2014-07-19 15:00    14.72   38.67
2014-07-19 16:00    14.94   39.47
2014-07-19 17:00    15.15   40.21
2014-07-19 18:00    15.34   40.89
2014-07-19 19:00    15.48   41.40
2014-07-19 20:00    15.62   41.89
2014-07-19 21:00    15.76   42.38
2014-07-19 22:00    15.87   42.79
2014-07-19 23:00    15.97   43.16
2014-07-20 00:00    16.05   43.44
2014-07-20 01:00    16.14   43.77
2014-07-20 02:00    16.24   44.10
2014-07-20 03:00    16.31   44.34
2014-07-20 04:00    16.39   44.63
2014-07-20 05:00    16.46   44.88
2014-07-20 06:00    16.53   45.13
2014-07-20 07:00    16.60   45.38
2014-07-20 08:00    16.67   45.63
2014-07-20 09:00    16.74   45.89
2014-07-20 10:00    16.84   46.25
2014-07-20 11:00    16.97   46.72
2014-07-20 12:00    17.12   47.24
2014-07-20 13:00    17.29   47.85
2014-07-20 14:00    17.45   48.44
2014-07-20 15:00    17.62   49.05
2014-07-20 16:00    17.79   49.65
2014-07-20 17:00    17.96   50.24
2014-07-20 18:00    18.11   50.78
2014-07-20 19:00    18.24   51.26
2014-07-20 20:00    18.35   51.63
2014-07-20 21:00    18.44   51.96
2014-07-20 22:00    18.51   52.23
2014-07-20 23:00    18.57   52.44
2014-07-21 00:00    18.63   52.63
2014-07-21 01:00    18.67   52.81
2014-07-21 02:00    18.71   52.95
2014-07-21 03:00    18.75   53.06
2014-07-21 04:00    18.78   53.19
2014-07-21 05:00    18.81   53.30
2014-07-21 06:00    18.84   53.41
2014-07-21 07:00    18.89   53.56
2014-07-21 08:00    18.93   53.72
2014-07-21 09:00    18.94   53.76
2014-07-21 10:00    19.04   54.10
2014-07-21 11:00    19.16   54.56
2014-07-21 12:00    19.31   55.09
2014-07-21 13:00    19.47   55.64
2014-07-21 14:00    19.63   56.23
2014-07-21 15:00    19.79   56.80
2014-07-21 16:00    19.96   57.39
2014-07-21 17:00    20.12   57.99
2014-07-21 18:00    20.28   58.55
2014-07-21 19:00    20.41   59.00
2014-07-21 20:00    20.53   59.45
2014-07-21 21:00    20.63   59.79
2014-07-21 22:00    20.70   60.06
2014-07-21 23:00    20.77   60.31
2014-07-22 00:00    20.82   60.48
2014-07-22 01:00    20.86   60.60
2014-07-22 02:00    20.87   60.67
2014-07-22 03:00    20.90   60.77
2014-07-22 04:00    20.91   60.80
2014-07-22 05:00    20.93   60.86
2014-07-22 06:00    20.93   60.89
2014-07-22 07:00    20.95   60.94
2014-07-22 08:00    20.97   61.02
2014-07-22 09:00    21.03   61.23
2014-07-22 10:00    21.11   61.52
2014-07-22 11:00    21.21   61.86
2014-07-22 12:00    21.34   62.32
2014-07-22 13:00    21.45   62.74
2014-07-22 14:00    21.61   63.32
2014-07-22 15:00    21.74   63.76
2014-07-22 16:00    21.88   64.28
2014-07-22 17:00    22.01   64.72
2014-07-22 18:00    22.09   65.01
2014-07-22 19:00    22.16   65.25
2014-07-22 20:00    22.27   65.66
2014-07-22 21:00    22.37   66.03
2014-07-22 22:00    22.45   66.29
2014-07-22 23:00    22.50   66.50
2014-07-23 00:00    22.55   66.66
2014-07-23 01:00    22.58   66.77
2014-07-23 02:00    22.61   66.86
2014-07-23 03:00    22.65   67.01
2014-07-23 04:00    22.67   67.07
2014-07-23 05:00    22.69   67.16
2014-07-23 06:00    22.71   67.24
2014-07-23 07:00    22.73   67.30
2014-07-23 08:00    22.77   67.44
2014-07-23 09:00    22.83   67.67
2014-07-23 10:00    22.92   67.98
2014-07-23 11:00    23.02   68.35
2014-07-23 12:00    23.15   68.81
2014-07-23 13:00    23.28   69.27
2014-07-23 14:00    23.42   69.76
2014-07-23 15:00    23.60   70.41
2014-07-23 16:00    23.76   70.99
2014-07-23 17:00    23.89   71.45
2014-07-23 18:00    24.01   71.88
2014-07-23 19:00    24.12   72.25
2014-07-23 20:00    24.19   72.51
2014-07-23 21:00    24.24   72.69
2014-07-23 22:00    24.28   72.83
2014-07-23 23:00    24.31   72.94
2014-07-24 00:00    24.33   73.02
2014-07-24 01:00    24.37   73.15
2014-07-24 02:00    24.41   73.30
2014-07-24 03:00    24.44   73.43
2014-07-24 04:00    24.48   73.54
2014-07-24 05:00    24.53   73.74
2014-07-24 06:00    24.57   73.87
2014-07-24 07:00    24.63   74.10
2014-07-24 08:00    24.70   74.35
2014-07-24 09:00    24.80   74.69
2014-07-24 10:00    24.90   75.07
2014-07-24 11:00    25.04   75.57
2014-07-24 12:00    25.20   76.11
2014-07-24 13:00    25.35   76.68
2014-07-24 14:00    25.52   77.26
2014-07-24 15:00    25.64   77.70
2014-07-24 16:00    25.80   78.29
2014-07-24 17:00    25.98   78.92
2014-07-24 18:00    26.13   79.46
2014-07-24 19:00    26.25   79.89
2014-07-24 20:00    26.33   80.16
2014-07-24 21:00    26.37   80.32
2014-07-24 22:00    26.39   80.38
2014-07-24 23:00    26.41   80.47
2014-07-25 00:00    26.47   80.65
2014-07-25 01:00    26.45   80.62
2014-07-25 02:00    26.50   80.78
2014-07-25 03:00    26.58   81.06
2014-07-25 04:00    26.58   81.06
2014-07-25 05:00    26.59   81.10
2014-07-25 06:00    26.61   81.15
2014-07-25 07:00    26.62   81.21
2014-07-25 08:00    26.71   81.51
2014-07-25 09:00    26.81   81.88
2014-07-25 10:00    26.92   82.29
2014-07-25 11:00    27.04   82.70
2014-07-25 12:00    27.19   83.26
2014-07-25 13:00    27.34   83.79
2014-07-25 14:00    27.49   84.32
2014-07-25 15:00    27.61   84.76
2014-07-25 16:00    27.71   85.09
2014-07-25 17:00    27.77   85.30
2014-07-25 18:00    27.78   85.35
2014-07-25 19:00    27.83   85.52
2014-07-25 20:00    27.88   85.70
2014-07-25 21:00    27.91   85.81
2014-07-25 22:00    27.83   85.55
2014-07-25 23:00    27.80   85.41
2014-07-26 00:00    27.77   85.33
2014-07-26 01:00    27.77   85.30
2014-07-26 02:00    27.75   85.26
2014-07-26 03:00    27.75   85.24
2014-07-26 04:00    27.74   85.22
2014-07-26 05:00    27.77   85.30
2014-07-26 06:00    27.78   85.35
2014-07-26 07:00    27.83   85.52
2014-07-26 08:00    27.86   85.66
2014-07-26 09:00    28.00   86.15
2014-07-26 10:00    28.17   86.74
2014-07-26 11:00    28.34   87.37
2014-07-26 12:00    28.51   87.97
2014-07-26 13:00    28.66   88.50
2014-07-26 14:00    28.81   89.02
2014-07-26 15:00    28.93   89.48
2014-07-26 16:00    29.02   89.79
2014-07-26 17:00    29.09   90.02
2014-07-26 18:00    29.09   90.02
2014-07-26 19:00    29.11   90.10
2014-07-26 20:00    29.06   89.91
2014-07-26 21:00    28.96   89.55
2014-07-26 22:00    28.82   89.07
2014-07-26 23:00    28.72   88.70
2014-07-27 00:00    28.62   88.35
2014-07-27 01:00    28.48   87.87
2014-07-27 02:00    28.42   87.65
2014-07-27 03:00    28.41   87.61
2014-07-27 04:00    28.34   87.37
2014-07-27 05:00    28.32   87.30
2014-07-27 06:00    28.31   87.25
2014-07-27 07:00    28.30   87.23
2014-07-27 08:00    28.34   87.37
2014-07-27 09:00    28.44   87.73
2014-07-27 10:00    28.59   88.26
2014-07-27 11:00    28.81   89.02
2014-07-27 12:00    29.03   89.81
2014-07-27 13:00    29.26   90.65
2014-07-27 14:00    29.47   91.38
2014-07-27 15:00    29.59   91.82
2014-07-27 16:00    29.68   92.13
2014-07-27 17:00    29.75   92.41
2014-07-27 18:00    29.47   91.41
2014-07-27 19:00    29.40   91.13
2014-07-27 20:00    29.31   90.84
2014-07-27 21:00    29.13   90.18
2014-07-27 22:00    28.97   89.61
2014-07-27 23:00    28.78   88.92
2014-07-28 00:00    28.70   88.62
2014-07-28 01:00    28.59   88.26
2014-07-28 02:00    28.57   88.18
2014-07-28 03:00    28.50   87.94
2014-07-28 04:00    28.47   87.82
2014-07-28 05:00    28.41   87.61
2014-07-28 06:00    28.40   87.58
2014-07-28 07:00    28.37   87.46
2014-07-28 08:00    28.38   87.49
2014-07-28 09:00    28.66   88.50
2014-07-28 10:00    28.94   89.50
2014-07-28 11:00    29.03   89.84
2014-07-28 12:00    29.22   90.49
2014-07-28 13:00    29.40   91.16
2014-07-28 14:00    29.59   91.82
2014-07-28 15:00    29.86   92.78
2014-07-28 16:00    30.21   94.05
2014-07-28 17:00    30.33   94.47
2014-07-28 18:00    30.34   94.50
2014-07-28 19:00    30.07   93.54
2014-07-28 20:00    29.84   92.72
2014-07-28 21:00    29.66   92.07
2014-07-28 22:00    29.53   91.63
2014-07-28 23:00    29.44   91.27
2014-07-29 00:00    29.34   90.94
2014-07-29 01:00    29.25   90.62
2014-07-29 02:00    29.26   90.65
2014-07-29 03:00    29.22   90.49
2014-07-29 04:00    29.20   90.44
2014-07-29 05:00    29.18   90.36
2014-07-29 06:00    29.19   90.39
2014-07-29 07:00    29.22   90.49
2014-07-29 08:00    29.34   90.92
2014-07-29 09:00    29.50   91.52
2014-07-29 10:00    29.75   92.41
2014-07-29 11:00    30.00   93.27
2014-07-29 12:00    30.24   94.14
2014-07-29 13:00    30.55   95.25
2014-07-29 14:00    30.76   96.02
2014-07-29 15:00    31.05   97.04
2014-07-29 16:00    31.22   97.65
2014-07-29 17:00    31.32   98.00
2014-07-29 18:00    31.32   98.00
2014-07-29 19:00    31.24   97.72
2014-07-29 20:00    31.05   97.04
2014-07-29 21:00    30.75   95.98
2014-07-29 22:00    30.37   94.63
2014-07-29 23:00    30.07   93.54
2014-07-30 00:00    29.92   93.01
2014-07-30 01:00    29.68   92.15
2014-07-30 02:00    29.50   91.49
2014-07-30 03:00    29.40   91.13
2014-07-30 04:00    29.23   90.54
2014-07-30 05:00    29.19   90.39
2014-07-30 06:00    29.09   90.04
2014-07-30 07:00    29.03   89.84
2014-07-30 08:00    29.10   90.07
2014-07-30 09:00    29.12   90.15
2014-07-30 10:00    29.22   90.52
2014-07-30 11:00    29.36   91.00
2014-07-30 12:00    29.56   91.71
2014-07-30 13:00    29.67   92.10
2014-07-30 14:00    29.87   92.81
2014-07-30 15:00    29.90   92.92
2014-07-30 16:00    30.03   93.39
2014-07-30 17:00    30.09   93.60
2014-07-30 18:00    30.05   93.45
2014-07-30 19:00    29.57   91.76
2014-07-30 20:00    29.38   91.08
2014-07-30 21:00    29.08   89.99
2014-07-30 22:00    28.90   89.35
2014-07-30 23:00    28.78   88.92
2014-07-31 00:00    28.65   88.48
2014-07-31 01:00    28.61   88.33
2014-07-31 02:00    28.54   88.06
2014-07-31 03:00    28.46   87.77
2014-07-31 04:00    28.36   87.44
2014-07-31 05:00    28.30   87.23
2014-07-31 06:00    27.95   85.97
2014-07-31 07:00    27.80   85.44
2014-07-31 08:00    28.49   87.89
2014-07-31 09:00    28.46   87.80
2014-07-31 10:00    28.54   88.06
2014-07-31 11:00    28.67   88.55
2014-07-31 12:00    28.93   89.48
2014-07-31 13:00    29.16   90.28
2014-07-31 14:00    29.34   90.92
2014-07-31 15:00    27.44   84.13
2014-07-31 16:00    25.04   75.56
2014-07-31 17:00    26.58   81.08
2014-07-31 18:00    27.47   84.23
2014-07-31 19:00    28.12   86.56
2014-07-31 20:00    28.17   86.76
2014-07-31 21:00    28.38   87.49
2014-07-31 22:00    28.57   88.18
2014-07-31 23:00    28.55   88.11
2014-08-16 00:00    26.62   81.20
2014-08-16 01:00    26.51   80.83
2014-08-16 02:00    26.41   80.47
2014-08-16 03:00    26.32   80.12
2014-08-16 04:00    26.22   79.79
2014-08-16 05:00    26.13   79.46
2014-08-16 06:00    26.04   79.15
2014-08-16 07:00    25.96   78.84
2014-08-16 08:00    25.88   78.55
2014-08-16 09:00    25.79   78.25
2014-08-16 10:00    25.72   77.97
2014-08-16 11:00    25.64   77.70
2014-08-16 12:00    25.56   77.43
2014-08-16 13:00    25.49   77.17
2014-08-16 14:00    25.42   76.91
2014-08-16 15:00    25.35   76.66
2014-08-16 16:00    25.28   76.42
2014-08-16 17:00    25.21   76.18
2014-08-16 18:00    25.15   75.94
2014-08-16 19:00    25.08   75.71
2014-08-16 20:00    25.02   75.49
2014-08-16 21:00    24.96   75.27
2014-08-16 22:00    24.90   75.05
2014-08-16 23:00    24.84   74.84
2014-08-17 00:00    24.78   74.64
2014-08-17 01:00    24.72   74.43
2014-08-17 02:00    24.67   74.23
2014-08-17 03:00    24.61   74.04
2014-08-17 04:00    24.56   73.84
2014-08-17 05:00    24.51   73.65
2014-08-17 06:00    24.46   73.47
2014-08-17 07:00    24.40   73.29
2014-08-17 08:00    24.35   73.11
2014-08-17 09:00    24.30   72.93
2014-08-17 10:00    24.26   72.75
2014-08-17 11:00    24.21   72.58
2014-08-17 12:00    24.16   72.41
2014-08-17 13:00    24.11   72.25
2014-08-17 14:00    24.07   72.08
2014-08-17 15:00    24.02   71.92
2014-08-17 16:00    23.98   71.76
2014-08-17 17:00    23.93   71.61
2014-08-17 18:00    23.89   71.45
2014-08-17 19:00    23.85   71.30
2014-08-17 20:00    23.81   71.15
2014-08-17 21:00    23.77   71.00
2014-08-17 22:00    23.72   70.86
2014-08-17 23:00    23.68   70.71
2014-08-18 00:00    23.64   70.57
2014-08-18 01:00    23.61   70.43
2014-08-18 02:00    23.57   70.29
2014-08-18 03:00    23.53   70.16
2014-08-18 04:00    23.49   70.02
2014-08-18 05:00    23.45   69.89
2014-08-18 06:00    23.42   69.76
2014-08-18 07:00    23.38   69.62
2014-08-18 08:00    23.34   69.50
2014-08-18 09:00    23.31   69.37
2014-08-18 10:00    23.27   69.24
2014-08-18 11:00    23.24   69.12
2014-08-18 12:00    23.20   69.00
2014-08-18 13:00    23.17   68.87
2014-08-18 14:00    23.14   68.75
2014-08-18 15:00    23.10   68.64
2014-08-18 16:00    23.07   68.52
2014-08-18 17:00    13.56   34.52
2014-08-18 18:00    10.51   23.61
2014-08-18 19:00    10.73   24.42
2014-08-18 20:00    11.36   26.65
2014-08-18 21:00    11.98   28.86
2014-08-18 22:00    12.52   30.83
2014-08-18 23:00    13.01   32.56
2014-08-19 00:00    13.44   34.08
2014-08-19 01:00    13.83   35.48
2014-08-19 02:00    14.19   36.77
2014-08-19 03:00    14.52   37.97
2014-08-19 04:00    14.84   39.11
2014-08-19 05:00    15.12   40.09
2014-08-19 06:00    15.37   41.01
2014-08-19 07:00    15.61   41.84
2014-08-19 08:00    15.68   42.11
2014-08-19 09:00    15.46   41.32
2014-08-19 10:00    13.57   34.55
2014-08-19 11:00    9.10    18.58
2014-08-19 12:00    8.89    17.82
2014-08-19 13:00    9.49    19.99
2014-08-19 14:00    9.71    20.76
2014-08-19 15:00    9.81    21.11
2014-08-19 16:00    10.12   22.22
2014-08-19 17:00    10.47   23.50
2014-08-19 18:00    10.80   24.67
2014-08-19 19:00    11.11   25.78
2014-08-19 20:00    11.38   26.73
2014-08-19 21:00    11.59   27.50
2014-08-19 22:00    11.79   28.21
2014-08-19 23:00    11.98   28.89
2014-08-20 00:00    12.16   29.53
2014-08-20 01:00    12.34   30.16
2014-08-20 02:00    12.52   30.80
2014-08-20 03:00    12.68   31.39
2014-08-20 04:00    12.84   31.97
2014-08-20 05:00    13.01   32.56
2014-08-20 06:00    13.16   33.10
2014-08-20 07:00    13.30   33.59
2014-08-20 08:00    13.44   34.08
2014-08-20 09:00    13.58   34.59
2014-08-20 10:00    13.70   35.03
2014-08-20 11:00    13.83   35.48
2014-08-20 12:00    13.96   35.94
2014-08-20 13:00    14.08   36.37
2014-08-20 14:00    14.19   36.77
2014-08-20 15:00    14.30   37.18
2014-08-20 16:00    14.42   37.59
2014-08-20 17:00    14.53   38.01
2014-08-20 18:00    14.64   38.40
2014-08-20 19:00    14.76   38.83
2014-08-20 20:00    14.88   39.23
2014-08-20 21:00    14.98   39.59
2014-08-20 22:00    15.05   39.84
2014-08-20 23:00    15.14   40.17
2014-08-21 00:00    15.22   40.46
2014-08-21 01:00    15.29   40.71
2014-08-21 02:00    15.36   40.97
2014-08-21 03:00    15.42   41.19
2014-08-21 04:00    15.50   41.45
2014-08-21 05:00    15.56   41.66
2014-08-21 06:00    15.62   41.89
2014-08-21 07:00    15.68   42.11
2014-08-21 08:00    15.74   42.33
2014-08-21 09:00    15.79   42.51
2014-08-21 10:00    15.86   42.74
2014-08-21 11:00    15.92   42.97
2014-08-21 12:00    15.97   43.16
2014-08-21 13:00    16.03   43.34
2014-08-21 14:00    15.54   41.62
2014-08-21 15:00    14.29   37.14
2014-08-21 16:00    13.58   34.59
2014-08-21 17:00    13.11   32.91
2014-08-21 18:00    12.91   32.22
2014-08-21 19:00    12.90   32.16
2014-08-21 20:00    12.91   32.19
2014-08-21 21:00    12.97   32.41
2014-08-21 22:00    13.06   32.75
2014-08-21 23:00    13.19   33.20
2014-08-22 00:00    13.32   33.65
2014-08-22 01:00    13.44   34.11
2014-08-22 02:00    13.60   34.65
2014-08-22 03:00    13.71   35.06
2014-08-22 04:00    13.84   35.52
2014-08-22 05:00    13.96   35.94
2014-08-22 06:00    14.07   36.33
2014-08-22 07:00    14.18   36.73
2014-08-22 08:00    14.28   37.10
2014-08-22 09:00    14.38   37.44
2014-08-22 10:00    14.45   37.70
2014-08-22 11:00    14.50   37.90
2014-08-22 12:00    14.60   38.24
2014-08-22 13:00    14.68   38.51
2014-08-22 14:00    14.69   38.55
2014-08-22 15:00    14.69   38.55
2014-08-22 16:00    14.42   37.59
2014-08-22 17:00    14.34   37.33
2014-08-22 18:00    14.35   37.36
2014-08-22 19:00    14.38   37.44
2014-08-22 20:00    14.17   36.70
2014-08-22 21:00    13.65   34.86
2014-08-22 22:00    13.67   34.93
2014-08-22 23:00    13.74   35.17
2014-08-23 00:00    13.81   35.41
2014-08-23 01:00    13.89   35.69
2014-08-23 02:00    13.98   36.01
2014-08-23 03:00    14.07   36.33
2014-08-23 04:00    14.16   36.66
2014-08-23 05:00    14.25   36.99
2014-08-23 06:00    14.34   37.33
2014-08-23 07:00    14.43   37.63
2014-08-23 08:00    14.52   37.97
2014-08-23 09:00    14.61   38.28
2014-08-23 10:00    14.70   38.59
2014-08-23 11:00    14.77   38.87
2014-08-23 12:00    14.85   39.15
2014-08-23 13:00    14.93   39.43
2014-08-23 14:00    15.02   39.76
2014-08-23 15:00    15.10   40.04
2014-08-23 16:00    15.20   40.38
2014-08-23 17:00    15.32   40.80
2014-08-23 18:00    15.42   41.19
2014-08-23 19:00    15.53   41.58
2014-08-23 20:00    15.61   41.84
2014-08-23 21:00    15.68   42.11
2014-08-23 22:00    15.74   42.33
2014-08-23 23:00    15.81   42.56
2014-08-24 00:00    15.86   42.74
2014-08-24 01:00    15.92   42.97
2014-08-24 02:00    15.63   41.93
2014-08-24 03:00    14.95   39.51
2014-08-24 04:00    14.99   39.63
2014-08-24 05:00    15.03   39.80
2014-08-24 06:00    15.07   39.92
2014-08-24 07:00    15.09   40.00
2014-08-24 08:00    15.13   40.13
2014-08-24 09:00    15.16   40.25
2014-08-24 10:00    15.20   40.38
2014-08-24 11:00    15.23   40.50
2014-08-24 12:00    15.27   40.63
2014-08-24 13:00    15.19   40.34
2014-08-24 14:00    14.90   39.31
2014-08-24 15:00    14.72   38.67
2014-08-24 16:00    14.36   37.40
2014-08-24 17:00    13.96   35.94
2014-08-24 18:00    13.13   33.01
2014-08-24 19:00    10.90   25.00
2014-08-24 20:00    9.67    20.62
2014-08-24 21:00    9.63    20.47
2014-08-24 22:00    9.92    21.50
2014-08-24 23:00    10.21   22.55
2014-08-25 00:00    10.52   23.66
2014-08-25 01:00    10.80   24.67
2014-08-25 02:00    11.06   25.61
2014-08-25 03:00    11.29   26.42
2014-08-25 04:00    11.51   27.19
2014-08-25 05:00    11.72   27.95
2014-08-25 06:00    11.90   28.59
2014-08-25 07:00    11.97   28.84
2014-08-25 08:00    12.02   29.03
2014-08-25 09:00    11.91   28.62
2014-08-25 10:00    11.82   28.32
2014-08-25 11:00    11.82   28.29
2014-08-25 12:00    11.85   28.40
2014-08-25 13:00    11.93   28.70
2014-08-25 14:00    12.02   29.03
2014-08-25 15:00    12.13   29.42
2014-08-25 16:00    12.24   29.81
2014-08-25 17:00    12.35   30.21
2014-08-25 18:00    12.48   30.65
2014-08-25 19:00    12.59   31.06
2014-08-25 20:00    12.72   31.51
2014-08-25 21:00    12.84   31.94
2014-08-25 22:00    12.96   32.37
2014-08-25 23:00    13.07   32.78
2014-08-26 00:00    13.19   33.20
2014-08-26 01:00    13.29   33.55
2014-08-26 02:00    13.39   33.92
2014-08-26 03:00    13.48   34.25
2014-08-26 04:00    13.57   34.55
2014-08-26 05:00    13.67   34.93
2014-08-26 06:00    13.75   35.20
2014-08-26 07:00    13.83   35.48
2014-08-26 08:00    13.90   35.73
2014-08-26 09:00    13.97   35.98
2014-08-26 10:00    14.05   36.26
2014-08-26 11:00    14.11   36.48
2014-08-26 12:00    14.09   36.41
2014-08-26 13:00    14.14   36.59
2014-08-26 14:00    14.23   36.92
2014-08-26 15:00    14.34   37.33
2014-08-26 16:00    14.45   37.70
2014-08-26 17:00    14.57   38.13
2014-08-26 18:00    14.68   38.51
2014-08-26 19:00    14.79   38.91
2014-08-26 20:00    14.89   39.27
2014-08-26 21:00    14.98   39.59
2014-08-26 22:00    15.06   39.88
2014-08-26 23:00    15.13   40.13
2014-08-27 00:00    15.20   40.38
2014-08-27 01:00    15.26   40.59
2014-08-27 02:00    15.32   40.80
2014-08-27 03:00    15.37   41.01
2014-08-27 04:00    15.42   41.19
2014-08-27 05:00    15.47   41.36
2014-08-27 06:00    15.53   41.58
2014-08-27 07:00    15.58   41.75
2014-08-27 08:00    15.62   41.89
2014-08-27 09:00    15.67   42.06
2014-08-27 10:00    15.72   42.24
2014-08-27 11:00    15.77   42.42
2014-08-27 12:00    15.83   42.65
2014-08-27 13:00    15.90   42.88
2014-08-27 14:00    15.96   43.11
2014-08-27 15:00    16.04   43.39
2014-08-27 16:00    16.12   43.67
2014-08-27 17:00    16.20   43.96
2014-08-27 18:00    16.29   44.29
2014-08-27 19:00    16.37   44.58
2014-08-27 20:00    16.46   44.88
2014-08-27 21:00    16.53   45.13
2014-08-27 22:00    16.60   45.38
2014-08-27 23:00    16.64   45.53
2014-08-28 00:00    16.70   45.73
2014-08-28 01:00    16.74   45.89
2014-08-28 02:00    16.77   45.99
2014-08-28 03:00    16.80   46.09
2014-08-28 04:00    16.84   46.25
2014-08-28 05:00    16.85   46.30
2014-08-28 06:00    16.87   46.35
2014-08-28 07:00    16.88   46.41
2014-08-28 08:00    16.90   46.46
2014-08-28 09:00    16.84   46.25
2014-08-28 10:00    16.77   45.99
2014-08-28 11:00    16.80   46.09
2014-08-28 12:00    16.83   46.20
2014-08-28 13:00    16.84   46.25
2014-08-28 14:00    16.85   46.30
2014-08-28 15:00    16.87   46.35
2014-08-28 16:00    16.90   46.46
2014-08-28 17:00    16.91   46.51
2014-08-28 18:00    16.94   46.62
2014-08-28 19:00    16.97   46.72
2014-08-28 20:00    17.02   46.88
2014-08-28 21:00    17.05   46.99
2014-08-28 22:00    17.07   47.08
2014-08-28 23:00    17.09   47.16
2014-08-29 00:00    17.11   47.23
2014-08-29 01:00    17.13   47.29
2014-08-29 02:00    17.13   47.29
2014-08-29 03:00    17.14   47.33
2014-08-29 04:00    17.15   47.37
2014-08-29 05:00    17.17   47.43
2014-08-29 06:00    17.14   47.34
2014-08-29 07:00    17.10   47.20
2014-08-29 08:00    17.13   47.29
2014-08-29 09:00    17.15   47.38
2014-08-29 10:00    17.17   47.44
2014-08-29 11:00    17.21   47.57
2014-08-29 12:00    17.27   47.78
2014-08-29 13:00    17.33   48.02
2014-08-29 14:00    17.41   48.29
2014-08-29 15:00    17.50   48.59
2014-08-29 16:00    17.58   48.91
2014-08-29 17:00    17.66   49.20
2014-08-29 18:00    17.73   49.42
2014-08-29 19:00    17.79   49.64
2014-08-29 20:00    17.85   49.85
2014-08-29 21:00    17.88   49.98
2014-08-29 22:00    17.90   50.05
2014-08-29 23:00    17.92   50.10
2014-08-30 00:00    17.93   50.16
2014-08-30 01:00    17.96   50.26
2014-08-30 02:00    17.97   50.27
2014-08-30 03:00    17.98   50.32
2014-08-30 04:00    17.98   50.33
2014-08-30 05:00    17.98   50.33
2014-08-30 06:00    17.99   50.36
2014-08-30 07:00    17.99   50.38
2014-08-30 08:00    18.00   50.40
2014-08-30 09:00    18.00   50.39
2014-08-30 10:00    18.00   50.41
2014-08-30 11:00    18.01   50.44
2014-08-30 12:00    18.05   50.56
2014-08-30 13:00    18.11   50.80
2014-08-30 14:00    18.17   51.02
2014-08-30 15:00    18.24   51.27
2014-08-30 16:00    18.32   51.56
2014-08-30 17:00    18.40   51.83
2014-08-30 18:00    18.48   52.12
2014-08-30 19:00    18.54   52.34
2014-08-30 20:00    18.60   52.53
2014-08-30 21:00    18.63   52.65
2014-08-30 22:00    18.65   52.72
2014-08-30 23:00    18.66   52.75
2014-08-31 00:00    18.67   52.81
2014-08-31 01:00    18.68   52.83
2014-08-31 02:00    18.70   52.90
2014-08-31 03:00    18.70   52.89
2014-08-31 04:00    18.69   52.87
2014-08-31 05:00    18.69   52.87
2014-08-31 06:00    18.69   52.85
2014-08-31 07:00    18.69   52.85
2014-08-31 08:00    18.68   52.84
2014-08-31 09:00    18.68   52.81
2014-08-31 10:00    18.66   52.74
2014-08-31 11:00    18.66   52.75
2014-08-31 12:00    18.68   52.82
2014-08-31 13:00    18.74   53.02
2014-08-31 14:00    18.81   53.31
2014-08-31 15:00    18.90   53.60
2014-08-31 16:00    18.97   53.87
2014-08-31 17:00    19.04   54.12
2014-08-31 18:00    19.12   54.39
2014-08-31 19:00    19.18   54.61
2014-08-31 20:00    19.22   54.75
2014-08-31 21:00    19.24   54.84
2014-08-31 22:00    19.26   54.91
2014-08-31 23:00    19.26   54.90

1 个答案:

答案 0 :(得分:0)

假设您的数据存储在数据框df中,您可以从DATE_TIME创建分组变量:

library(lubridate) # for handling your date_time
library(ggplot2)   # for plotting

df$DATE_TIME <- ymd_hm(df$DATE_TIME)
df$year_month <- paste(month(df$DATE_TIME), year(df$DATE_TIME), sep="-")

ggplot(df, aes(year_month, WT_R)) +
  geom_boxplot() 

更简单的方法是让ggplot使用interaction()来处理整个分组:

ggplot(df, aes(interaction(month(DATE_TIME, label = TRUE), year(DATE_TIME)), WT_R)) +
  geom_boxplot()

在提取每个观察月份时指定label = TRUE会为您提供月份的(缩写)名称而不是其编号。