# Consulting

### 1 thought on “Consulting”

1. Bhim

Hi, Can I get some help?
Recently I got chance to read "Count consecutive number of days with condition in R" in this website. I had some problems in calculating the consecutive hours.
For example, I have a data frame which is a hourly weather data as mentioned below. I am trying to calculate the number of days within a specified period (for eg start date: 11/15/13 and End date: 11/19/13) having '2m T avg (F)' in between 65-75 & 'RelHum avg 2m (pct)' >=90 consecutive for 4 or more than 4 hours. Both temperature and relative humidity conditions mentioned above should satisfy the condition of consecutive for 4 or more than 4 hours. I tried to calculate for individual conditions but I have a large data set and I had to calculate for different start and end dates, which is making me difficult to do separately. I would greatly appreciate if you can help me in this problem. Thanks
Period 2m T avg (F) RelHum avg 2m (pct)
11/15/13 0:00 57.91 93
11/15/13 1:00 57.93 93
11/15/13 2:00 58.8 92
11/15/13 3:00 58.99 92
11/15/13 4:00 58.79 93
11/15/13 5:00 59.56 94
11/15/13 6:00 59.82 94
11/15/13 7:00 61.39 95
11/15/13 8:00 66.56 92
11/15/13 9:00 72.93 82
11/15/13 10:00 76.79 72
11/15/13 11:00 77.82 70
11/15/13 12:00 77.99 70
11/15/13 13:00 78.69 68
11/15/13 14:00 77.66 70
11/15/13 15:00 76.94 70
11/15/13 16:00 76.53 70
11/15/13 17:00 74.7 76
11/15/13 18:00 72.96 81
11/15/13 19:00 71.63 84
11/15/13 20:00 70.79 87
11/15/13 21:00 70.33 88
11/15/13 22:00 68.49 90
11/15/13 23:00 67.86 92
11/16/13 0:00 68.81 92
11/16/13 1:00 69.3 91
11/16/13 2:00 69.07 92
11/16/13 3:00 69.35 92
11/16/13 4:00 69.33 93
11/16/13 5:00 69.3 94
11/16/13 6:00 69.04 95
11/16/13 7:00 69.08 95
11/16/13 8:00 70.73 95
11/16/13 9:00 72.86 94
11/16/13 10:00 75.15 93
11/16/13 11:00 76.09 89
11/16/13 12:00 74.88 88
11/16/13 13:00 70.3 91
11/16/13 14:00 68.49 91
11/16/13 15:00 68.74 92
11/16/13 16:00 70.11 90
11/16/13 17:00 70.61 85
11/16/13 18:00 70.11 85
11/16/13 19:00 69.79 91
11/16/13 20:00 69.45 92
11/16/13 21:00 68.67 94
11/16/13 22:00 67.25 95
11/16/13 23:00 66.38 96
11/17/13 0:00 66.6 96
11/17/13 1:00 67.41 97
11/17/13 2:00 68.06 97
11/17/13 3:00 68.26 97
11/17/13 4:00 68.76 97
11/17/13 5:00 67.92 97
11/17/13 6:00 68.06 97
11/17/13 7:00 69.14 97
11/17/13 8:00 71.67 97
11/17/13 9:00 76.87 93
11/17/13 10:00 80.19 81
11/17/13 11:00 82.25 72
11/17/13 12:00 83.07 67
11/17/13 13:00 83.23 68
11/17/13 14:00 81.91 73
11/17/13 15:00 80.65 75
11/17/13 16:00 80.15 73
11/17/13 17:00 77.37 80
11/17/13 18:00 72.9 86
11/17/13 19:00 69.89 92
11/17/13 20:00 68.72 94
11/17/13 21:00 68.09 95
11/17/13 22:00 67.43 95
11/17/13 23:00 65.87 96
11/18/13 0:00 65.25 96
11/18/13 1:00 64.51 97
11/18/13 2:00 65.03 97
11/18/13 3:00 65.17 97
11/18/13 4:00 63.97 97
11/18/13 5:00 64.32 98
11/18/13 6:00 64.32 98
11/18/13 7:00 67.92 98
11/18/13 8:00 71.31 98
11/18/13 9:00 74.5 97
11/18/13 10:00 77.78 90
11/18/13 11:00 80.79 78
11/18/13 12:00 81.82 74
11/18/13 13:00 82.27 69
11/18/13 14:00 83.19 69
11/18/13 15:00 83.64 66
11/18/13 16:00 83.12 64
11/18/13 17:00 79.83 70
11/18/13 18:00 75.1 84
11/18/13 19:00 72.25 91
11/18/13 20:00 70.61 94
11/18/13 21:00 70.22 95
11/18/13 22:00 70.8 95
11/18/13 23:00 71.47 95
11/19/13 0:00 71.51 95
11/19/13 1:00 70.45 96
11/19/13 2:00 69.83 96