loading libraries

library(tidyr)
library(dplyr)
## 
## Attaching package: 'dplyr'
## The following objects are masked from 'package:stats':
## 
##     filter, lag
## The following objects are masked from 'package:base':
## 
##     intersect, setdiff, setequal, union
library(zoo)
## Warning: package 'zoo' was built under R version 3.4.2
## 
## Attaching package: 'zoo'
## The following objects are masked from 'package:base':
## 
##     as.Date, as.Date.numeric

Reading csv files

dfrW<- read.csv("weather-data.csv",header=T, stringsAsFactors=FALSE)
nrow(dfrW)
## [1] 153
ncol(dfrW)
## [1] 6
str(dfrW)
## 'data.frame':    153 obs. of  6 variables:
##  $ Month: int  5 5 5 5 5 5 5 5 5 5 ...
##  $ Day  : int  1 2 3 4 5 6 7 8 9 10 ...
##  $ Ozone: int  41 36 12 18 NA 28 23 19 8 NA ...
##  $ Solar: int  190 118 149 313 NA NA 299 99 19 194 ...
##  $ Wind : num  7.4 NA 12.6 11.5 14.3 14.9 8.6 13.8 20.1 8.6 ...
##  $ Temp : int  67 72 74 62 56 66 65 59 61 69 ...
summary(dfrW)
##      Month            Day           Ozone            Solar      
##  Min.   :5.000   Min.   : 1.0   Min.   :  1.00   Min.   :  7.0  
##  1st Qu.:6.000   1st Qu.: 8.0   1st Qu.: 18.00   1st Qu.:115.8  
##  Median :7.000   Median :16.0   Median : 31.50   Median :205.0  
##  Mean   :6.993   Mean   :15.8   Mean   : 42.13   Mean   :185.9  
##  3rd Qu.:8.000   3rd Qu.:23.0   3rd Qu.: 63.25   3rd Qu.:258.8  
##  Max.   :9.000   Max.   :31.0   Max.   :168.00   Max.   :334.0  
##                                 NA's   :37       NA's   :7      
##       Wind             Temp      
##  Min.   : 1.700   Min.   :56.00  
##  1st Qu.: 7.400   1st Qu.:72.50  
##  Median : 9.700   Median :79.00  
##  Mean   : 9.965   Mean   :77.98  
##  3rd Qu.:11.875   3rd Qu.:85.00  
##  Max.   :20.700   Max.   :97.00  
##  NA's   :3        NA's   :2
colnames(dfrW)
## [1] "Month" "Day"   "Ozone" "Solar" "Wind"  "Temp"
View(dfrW)

detecting Na in Ozone,Solar,Wind,Temperature

detectNAs <- function(inp){
  return(sum(is.na(inp)))}       

lapply(dfrW, FUN=detectNAs)
## $Month
## [1] 0
## 
## $Day
## [1] 0
## 
## $Ozone
## [1] 37
## 
## $Solar
## [1] 7
## 
## $Wind
## [1] 3
## 
## $Temp
## [1] 2

Populate NA readings of Ozone using average of all valid values.

dfrW$Ozone <- ifelse(is.na(dfrW$Ozone), mean(dfrW$Ozone, na.rm=TRUE), dfrW$Ozone)

Populate NA readings of Solar using average of all valid values

dfrW$Solar <- ifelse(is.na(dfrW$Solar), mean(dfrW$Solar, na.rm=TRUE), dfrW$Solar)

Populate NA readings of Wind & Temp using average of valid values above & below the reading

y <- which(is.na(dfrW$Wind))
dfrW$Wind[y] <- sapply(y, function(i) with(dfrW, mean(c(dfrW$wind[i-1], dfrW$Wind[i+1]))))
dfrW
##     Month Day     Ozone    Solar Wind Temp
## 1       5   1  41.00000 190.0000  7.4   67
## 2       5   2  36.00000 118.0000 12.6   72
## 3       5   3  12.00000 149.0000 12.6   74
## 4       5   4  18.00000 313.0000 11.5   62
## 5       5   5  42.12931 185.9315 14.3   56
## 6       5   6  28.00000 185.9315 14.9   66
## 7       5   7  23.00000 299.0000  8.6   65
## 8       5   8  19.00000  99.0000 13.8   59
## 9       5   9   8.00000  19.0000 20.1   61
## 10      5  10  42.12931 194.0000  8.6   69
## 11      5  11   7.00000 185.9315  6.9   74
## 12      5  12  16.00000 256.0000  9.7   69
## 13      5  13  11.00000 290.0000  9.2   NA
## 14      5  14  14.00000 274.0000 10.9   68
## 15      5  15  18.00000  65.0000 13.2   58
## 16      5  16  14.00000 334.0000 11.5   64
## 17      5  17  34.00000 307.0000 12.0   66
## 18      5  18   6.00000  78.0000 18.4   57
## 19      5  19  30.00000 322.0000 11.5   68
## 20      5  20  11.00000  44.0000  9.7   62
## 21      5  21   1.00000   8.0000  9.7   59
## 22      5  22  11.00000 320.0000 16.6   73
## 23      5  23   4.00000  25.0000  9.7   61
## 24      5  24  32.00000  92.0000 12.0   61
## 25      5  25  42.12931  66.0000 16.6   57
## 26      5  26  42.12931 266.0000 14.9   58
## 27      5  27  42.12931 185.9315  8.0   57
## 28      5  28  23.00000  13.0000 12.0   67
## 29      5  29  45.00000 252.0000 14.9   81
## 30      5  30 115.00000 223.0000  5.7   79
## 31      5  31  37.00000 279.0000  7.4   76
## 32      6   1  42.12931 286.0000  8.6   78
## 33      6   2  42.12931 287.0000  9.7   74
## 34      6   3  42.12931 242.0000 16.1   67
## 35      6   4  42.12931 186.0000  9.2   84
## 36      6   5  42.12931 220.0000  8.6   85
## 37      6   6  42.12931 264.0000 14.3   79
## 38      6   7  29.00000 127.0000  9.7   82
## 39      6   8  42.12931 273.0000  6.9   87
## 40      6   9  71.00000 291.0000 13.8   90
## 41      6  10  39.00000 323.0000 11.5   87
## 42      6  11  42.12931 259.0000 10.9   93
## 43      6  12  42.12931 250.0000  9.2   92
## 44      6  13  23.00000 148.0000  8.0   82
## 45      6  14  42.12931 332.0000 13.8   80
## 46      6  15  42.12931 322.0000 11.5   79
## 47      6  16  21.00000 191.0000 14.9   77
## 48      6  17  37.00000 284.0000 20.7   72
## 49      6  18  20.00000  37.0000 11.5   65
## 50      6  19  12.00000 120.0000 11.5   73
## 51      6  20  13.00000 137.0000 10.3   76
## 52      6  21  42.12931 150.0000  6.3   77
## 53      6  22  42.12931  59.0000  1.7   76
## 54      6  23  42.12931  91.0000  4.6   76
## 55      6  24  42.12931 250.0000  6.3   76
## 56      6  25  42.12931 135.0000  8.0   NA
## 57      6  26  42.12931 127.0000  8.0   78
## 58      6  27  42.12931  47.0000 10.3   73
## 59      6  28  42.12931  98.0000 11.5   80
## 60      6  29  42.12931  31.0000 14.9   77
## 61      6  30  42.12931 138.0000  8.0   83
## 62      7   1 135.00000 269.0000  4.1   84
## 63      7   2  49.00000 248.0000  9.2   85
## 64      7   3  32.00000 236.0000  9.2   81
## 65      7   4  42.12931 101.0000 10.9   84
## 66      7   5  64.00000 175.0000  4.6   83
## 67      7   6  40.00000 314.0000 10.9   83
## 68      7   7  77.00000 276.0000  5.1   88
## 69      7   8  97.00000 267.0000  6.3   92
## 70      7   9  97.00000 272.0000  5.7   92
## 71      7  10  85.00000 175.0000  7.4   89
## 72      7  11  42.12931 139.0000  8.6   82
## 73      7  12  10.00000 264.0000 14.3   73
## 74      7  13  27.00000 175.0000 14.9   81
## 75      7  14  42.12931 291.0000 14.9   91
## 76      7  15   7.00000  48.0000 14.3   80
## 77      7  16  48.00000 260.0000  6.9   81
## 78      7  17  35.00000 274.0000 10.3   82
## 79      7  18  61.00000 285.0000  6.3   84
## 80      7  19  79.00000 187.0000  5.1   87
## 81      7  20  63.00000 220.0000 11.5   85
## 82      7  21  16.00000   7.0000  6.9   74
## 83      7  22  42.12931 258.0000  9.7   81
## 84      7  23  42.12931 295.0000 11.5   82
## 85      7  24  80.00000 294.0000  8.6   86
## 86      7  25 108.00000 223.0000  8.0   85
## 87      7  26  20.00000  81.0000  8.6   82
## 88      7  27  52.00000  82.0000 12.0   86
## 89      7  28  82.00000 213.0000  7.4   88
## 90      7  29  50.00000 275.0000  7.4   86
## 91      7  30  64.00000 253.0000  7.4   83
## 92      7  31  59.00000 254.0000  9.2   81
## 93      8   1  39.00000  83.0000  6.9   81
## 94      8   2   9.00000  24.0000 13.8   81
## 95      8   3  16.00000  77.0000  7.4   82
## 96      8   4  78.00000 185.9315  6.9   86
## 97      8   5  35.00000 185.9315  7.4   85
## 98      8   6  66.00000 185.9315  4.6   87
## 99      8   7 122.00000 255.0000  4.0   89
## 100     8   8  89.00000 229.0000 10.3   90
## 101     8   9 110.00000 207.0000  8.0   90
## 102     8  10  42.12931 222.0000  8.6   92
## 103     8  11  42.12931 137.0000 11.5   86
## 104     8  12  44.00000 192.0000 11.5   86
## 105     8  13  28.00000 273.0000 11.5   82
## 106     8  14  65.00000 157.0000  9.7   80
## 107     8  15  42.12931  64.0000 11.5   79
## 108     8  16  22.00000  71.0000 10.3   77
## 109     8  17  59.00000  51.0000  6.3   79
## 110     8  18  23.00000 115.0000  7.4   76
## 111     8  19  31.00000 244.0000 10.9   78
## 112     8  20  44.00000 190.0000 10.3   78
## 113     8  21  21.00000 259.0000 15.5   77
## 114     8  22   9.00000  36.0000 14.3   72
## 115     8  23  42.12931 255.0000 12.6   75
## 116     8  24  45.00000 212.0000  9.7   79
## 117     8  25 168.00000 238.0000  3.4   81
## 118     8  26  73.00000 215.0000  8.0   86
## 119     8  27  42.12931 153.0000  5.7   88
## 120     8  28  76.00000 203.0000  9.7   97
## 121     8  29 118.00000 225.0000  2.3   94
## 122     8  30  84.00000 237.0000  6.3   96
## 123     8  31  85.00000 188.0000  6.3   94
## 124     9   1  96.00000 167.0000  6.9   91
## 125     9   2  78.00000 197.0000  5.1   92
## 126     9   3  73.00000 183.0000  2.8   93
## 127     9   4  91.00000 189.0000  4.6   93
## 128     9   5  47.00000  95.0000  7.4   87
## 129     9   6  32.00000  92.0000 15.5   84
## 130     9   7  20.00000 252.0000 10.9   80
## 131     9   8  23.00000 220.0000 10.3   78
## 132     9   9  21.00000 230.0000 10.9   75
## 133     9  10  24.00000 259.0000  9.7   73
## 134     9  11  44.00000 236.0000 14.9   81
## 135     9  12  21.00000 259.0000 15.5   76
## 136     9  13  28.00000 238.0000  6.3   77
## 137     9  14   9.00000  24.0000 10.9   71
## 138     9  15  13.00000 112.0000 11.5   71
## 139     9  16  46.00000 237.0000  6.9   78
## 140     9  17  18.00000 224.0000 13.8   67
## 141     9  18  13.00000  27.0000 10.3   76
## 142     9  19  24.00000 238.0000 10.3   68
## 143     9  20  16.00000 201.0000  8.0   82
## 144     9  21  13.00000 238.0000 12.6   64
## 145     9  22  23.00000  14.0000  9.2   71
## 146     9  23  36.00000 139.0000 10.3   81
## 147     9  24   7.00000  49.0000 10.3   69
## 148     9  25  14.00000  20.0000 16.6   63
## 149     9  26  30.00000 193.0000  6.9   70
## 150     9  27  42.12931 145.0000 13.2   77
## 151     9  28  14.00000 191.0000 14.3   75
## 152     9  29  18.00000 131.0000  8.0   76
## 153     9  30  20.00000 223.0000   NA   68
library(zoo)
dfrW$Wind[dfrW$Wind == ""] <- NA
dfrW$Wind <- na.locf(dfrW$Wind)

Populate NA readings of Temp using average of valid values above & below the reading

x <- which(is.na(dfrW$Temp))
dfrW$Temp[x] <- sapply(x, function(i) with(dfrW, mean(c(dfrW$Temp[i-1], dfrW$Temp[i+1]))))
dfrW
##     Month Day     Ozone    Solar Wind Temp
## 1       5   1  41.00000 190.0000  7.4 67.0
## 2       5   2  36.00000 118.0000 12.6 72.0
## 3       5   3  12.00000 149.0000 12.6 74.0
## 4       5   4  18.00000 313.0000 11.5 62.0
## 5       5   5  42.12931 185.9315 14.3 56.0
## 6       5   6  28.00000 185.9315 14.9 66.0
## 7       5   7  23.00000 299.0000  8.6 65.0
## 8       5   8  19.00000  99.0000 13.8 59.0
## 9       5   9   8.00000  19.0000 20.1 61.0
## 10      5  10  42.12931 194.0000  8.6 69.0
## 11      5  11   7.00000 185.9315  6.9 74.0
## 12      5  12  16.00000 256.0000  9.7 69.0
## 13      5  13  11.00000 290.0000  9.2 68.5
## 14      5  14  14.00000 274.0000 10.9 68.0
## 15      5  15  18.00000  65.0000 13.2 58.0
## 16      5  16  14.00000 334.0000 11.5 64.0
## 17      5  17  34.00000 307.0000 12.0 66.0
## 18      5  18   6.00000  78.0000 18.4 57.0
## 19      5  19  30.00000 322.0000 11.5 68.0
## 20      5  20  11.00000  44.0000  9.7 62.0
## 21      5  21   1.00000   8.0000  9.7 59.0
## 22      5  22  11.00000 320.0000 16.6 73.0
## 23      5  23   4.00000  25.0000  9.7 61.0
## 24      5  24  32.00000  92.0000 12.0 61.0
## 25      5  25  42.12931  66.0000 16.6 57.0
## 26      5  26  42.12931 266.0000 14.9 58.0
## 27      5  27  42.12931 185.9315  8.0 57.0
## 28      5  28  23.00000  13.0000 12.0 67.0
## 29      5  29  45.00000 252.0000 14.9 81.0
## 30      5  30 115.00000 223.0000  5.7 79.0
## 31      5  31  37.00000 279.0000  7.4 76.0
## 32      6   1  42.12931 286.0000  8.6 78.0
## 33      6   2  42.12931 287.0000  9.7 74.0
## 34      6   3  42.12931 242.0000 16.1 67.0
## 35      6   4  42.12931 186.0000  9.2 84.0
## 36      6   5  42.12931 220.0000  8.6 85.0
## 37      6   6  42.12931 264.0000 14.3 79.0
## 38      6   7  29.00000 127.0000  9.7 82.0
## 39      6   8  42.12931 273.0000  6.9 87.0
## 40      6   9  71.00000 291.0000 13.8 90.0
## 41      6  10  39.00000 323.0000 11.5 87.0
## 42      6  11  42.12931 259.0000 10.9 93.0
## 43      6  12  42.12931 250.0000  9.2 92.0
## 44      6  13  23.00000 148.0000  8.0 82.0
## 45      6  14  42.12931 332.0000 13.8 80.0
## 46      6  15  42.12931 322.0000 11.5 79.0
## 47      6  16  21.00000 191.0000 14.9 77.0
## 48      6  17  37.00000 284.0000 20.7 72.0
## 49      6  18  20.00000  37.0000 11.5 65.0
## 50      6  19  12.00000 120.0000 11.5 73.0
## 51      6  20  13.00000 137.0000 10.3 76.0
## 52      6  21  42.12931 150.0000  6.3 77.0
## 53      6  22  42.12931  59.0000  1.7 76.0
## 54      6  23  42.12931  91.0000  4.6 76.0
## 55      6  24  42.12931 250.0000  6.3 76.0
## 56      6  25  42.12931 135.0000  8.0 77.0
## 57      6  26  42.12931 127.0000  8.0 78.0
## 58      6  27  42.12931  47.0000 10.3 73.0
## 59      6  28  42.12931  98.0000 11.5 80.0
## 60      6  29  42.12931  31.0000 14.9 77.0
## 61      6  30  42.12931 138.0000  8.0 83.0
## 62      7   1 135.00000 269.0000  4.1 84.0
## 63      7   2  49.00000 248.0000  9.2 85.0
## 64      7   3  32.00000 236.0000  9.2 81.0
## 65      7   4  42.12931 101.0000 10.9 84.0
## 66      7   5  64.00000 175.0000  4.6 83.0
## 67      7   6  40.00000 314.0000 10.9 83.0
## 68      7   7  77.00000 276.0000  5.1 88.0
## 69      7   8  97.00000 267.0000  6.3 92.0
## 70      7   9  97.00000 272.0000  5.7 92.0
## 71      7  10  85.00000 175.0000  7.4 89.0
## 72      7  11  42.12931 139.0000  8.6 82.0
## 73      7  12  10.00000 264.0000 14.3 73.0
## 74      7  13  27.00000 175.0000 14.9 81.0
## 75      7  14  42.12931 291.0000 14.9 91.0
## 76      7  15   7.00000  48.0000 14.3 80.0
## 77      7  16  48.00000 260.0000  6.9 81.0
## 78      7  17  35.00000 274.0000 10.3 82.0
## 79      7  18  61.00000 285.0000  6.3 84.0
## 80      7  19  79.00000 187.0000  5.1 87.0
## 81      7  20  63.00000 220.0000 11.5 85.0
## 82      7  21  16.00000   7.0000  6.9 74.0
## 83      7  22  42.12931 258.0000  9.7 81.0
## 84      7  23  42.12931 295.0000 11.5 82.0
## 85      7  24  80.00000 294.0000  8.6 86.0
## 86      7  25 108.00000 223.0000  8.0 85.0
## 87      7  26  20.00000  81.0000  8.6 82.0
## 88      7  27  52.00000  82.0000 12.0 86.0
## 89      7  28  82.00000 213.0000  7.4 88.0
## 90      7  29  50.00000 275.0000  7.4 86.0
## 91      7  30  64.00000 253.0000  7.4 83.0
## 92      7  31  59.00000 254.0000  9.2 81.0
## 93      8   1  39.00000  83.0000  6.9 81.0
## 94      8   2   9.00000  24.0000 13.8 81.0
## 95      8   3  16.00000  77.0000  7.4 82.0
## 96      8   4  78.00000 185.9315  6.9 86.0
## 97      8   5  35.00000 185.9315  7.4 85.0
## 98      8   6  66.00000 185.9315  4.6 87.0
## 99      8   7 122.00000 255.0000  4.0 89.0
## 100     8   8  89.00000 229.0000 10.3 90.0
## 101     8   9 110.00000 207.0000  8.0 90.0
## 102     8  10  42.12931 222.0000  8.6 92.0
## 103     8  11  42.12931 137.0000 11.5 86.0
## 104     8  12  44.00000 192.0000 11.5 86.0
## 105     8  13  28.00000 273.0000 11.5 82.0
## 106     8  14  65.00000 157.0000  9.7 80.0
## 107     8  15  42.12931  64.0000 11.5 79.0
## 108     8  16  22.00000  71.0000 10.3 77.0
## 109     8  17  59.00000  51.0000  6.3 79.0
## 110     8  18  23.00000 115.0000  7.4 76.0
## 111     8  19  31.00000 244.0000 10.9 78.0
## 112     8  20  44.00000 190.0000 10.3 78.0
## 113     8  21  21.00000 259.0000 15.5 77.0
## 114     8  22   9.00000  36.0000 14.3 72.0
## 115     8  23  42.12931 255.0000 12.6 75.0
## 116     8  24  45.00000 212.0000  9.7 79.0
## 117     8  25 168.00000 238.0000  3.4 81.0
## 118     8  26  73.00000 215.0000  8.0 86.0
## 119     8  27  42.12931 153.0000  5.7 88.0
## 120     8  28  76.00000 203.0000  9.7 97.0
## 121     8  29 118.00000 225.0000  2.3 94.0
## 122     8  30  84.00000 237.0000  6.3 96.0
## 123     8  31  85.00000 188.0000  6.3 94.0
## 124     9   1  96.00000 167.0000  6.9 91.0
## 125     9   2  78.00000 197.0000  5.1 92.0
## 126     9   3  73.00000 183.0000  2.8 93.0
## 127     9   4  91.00000 189.0000  4.6 93.0
## 128     9   5  47.00000  95.0000  7.4 87.0
## 129     9   6  32.00000  92.0000 15.5 84.0
## 130     9   7  20.00000 252.0000 10.9 80.0
## 131     9   8  23.00000 220.0000 10.3 78.0
## 132     9   9  21.00000 230.0000 10.9 75.0
## 133     9  10  24.00000 259.0000  9.7 73.0
## 134     9  11  44.00000 236.0000 14.9 81.0
## 135     9  12  21.00000 259.0000 15.5 76.0
## 136     9  13  28.00000 238.0000  6.3 77.0
## 137     9  14   9.00000  24.0000 10.9 71.0
## 138     9  15  13.00000 112.0000 11.5 71.0
## 139     9  16  46.00000 237.0000  6.9 78.0
## 140     9  17  18.00000 224.0000 13.8 67.0
## 141     9  18  13.00000  27.0000 10.3 76.0
## 142     9  19  24.00000 238.0000 10.3 68.0
## 143     9  20  16.00000 201.0000  8.0 82.0
## 144     9  21  13.00000 238.0000 12.6 64.0
## 145     9  22  23.00000  14.0000  9.2 71.0
## 146     9  23  36.00000 139.0000 10.3 81.0
## 147     9  24   7.00000  49.0000 10.3 69.0
## 148     9  25  14.00000  20.0000 16.6 63.0
## 149     9  26  30.00000 193.0000  6.9 70.0
## 150     9  27  42.12931 145.0000 13.2 77.0
## 151     9  28  14.00000 191.0000 14.3 75.0
## 152     9  29  18.00000 131.0000  8.0 76.0
## 153     9  30  20.00000 223.0000  8.0 68.0

Add a new column to show weather status assuming suitable range for the classification

Temperature - Very Hot, Hot, Mild, Cool, Cold

Wind Speed - Storm, Windy, Breezy, Slow Wind, Still

Weather Status sample - Hot & Still, Cold & Windy, Cool & Breezy etc

dfrW$TempStatus <-ifelse(dfrW$Temp<65,"Cold",
                    ifelse(dfrW$Temp>=65 & dfrW$Temp<75,"Cool",
                           ifelse(dfrW$Temp>=75 & dfrW$Temp<85,"mild",
                                  ifelse(dfrW$Temp>=85 & dfrW$Temp<95,"Hot","Very Hot"
                                  ))))

dfrW$WindSpeed <-ifelse(dfrW$Wind<5,"Still",
                   ifelse(dfrW$Wind>=5 & dfrW$Wind<10,"Slow Wind",
                          ifelse(dfrW$Wind>=10 & dfrW$Wind<15,"Breezy",
                                 ifelse(dfrW$Wind>=15 & dfrW$Wind<20,"Windy","Storm"
                                 ))))

dfrW$WeatherStatus <- paste(dfrW$TempStatus,dfrW$WindSpeed)
dfrW
##     Month Day     Ozone    Solar Wind Temp TempStatus WindSpeed
## 1       5   1  41.00000 190.0000  7.4 67.0       Cool Slow Wind
## 2       5   2  36.00000 118.0000 12.6 72.0       Cool    Breezy
## 3       5   3  12.00000 149.0000 12.6 74.0       Cool    Breezy
## 4       5   4  18.00000 313.0000 11.5 62.0       Cold    Breezy
## 5       5   5  42.12931 185.9315 14.3 56.0       Cold    Breezy
## 6       5   6  28.00000 185.9315 14.9 66.0       Cool    Breezy
## 7       5   7  23.00000 299.0000  8.6 65.0       Cool Slow Wind
## 8       5   8  19.00000  99.0000 13.8 59.0       Cold    Breezy
## 9       5   9   8.00000  19.0000 20.1 61.0       Cold     Storm
## 10      5  10  42.12931 194.0000  8.6 69.0       Cool Slow Wind
## 11      5  11   7.00000 185.9315  6.9 74.0       Cool Slow Wind
## 12      5  12  16.00000 256.0000  9.7 69.0       Cool Slow Wind
## 13      5  13  11.00000 290.0000  9.2 68.5       Cool Slow Wind
## 14      5  14  14.00000 274.0000 10.9 68.0       Cool    Breezy
## 15      5  15  18.00000  65.0000 13.2 58.0       Cold    Breezy
## 16      5  16  14.00000 334.0000 11.5 64.0       Cold    Breezy
## 17      5  17  34.00000 307.0000 12.0 66.0       Cool    Breezy
## 18      5  18   6.00000  78.0000 18.4 57.0       Cold     Windy
## 19      5  19  30.00000 322.0000 11.5 68.0       Cool    Breezy
## 20      5  20  11.00000  44.0000  9.7 62.0       Cold Slow Wind
## 21      5  21   1.00000   8.0000  9.7 59.0       Cold Slow Wind
## 22      5  22  11.00000 320.0000 16.6 73.0       Cool     Windy
## 23      5  23   4.00000  25.0000  9.7 61.0       Cold Slow Wind
## 24      5  24  32.00000  92.0000 12.0 61.0       Cold    Breezy
## 25      5  25  42.12931  66.0000 16.6 57.0       Cold     Windy
## 26      5  26  42.12931 266.0000 14.9 58.0       Cold    Breezy
## 27      5  27  42.12931 185.9315  8.0 57.0       Cold Slow Wind
## 28      5  28  23.00000  13.0000 12.0 67.0       Cool    Breezy
## 29      5  29  45.00000 252.0000 14.9 81.0       mild    Breezy
## 30      5  30 115.00000 223.0000  5.7 79.0       mild Slow Wind
## 31      5  31  37.00000 279.0000  7.4 76.0       mild Slow Wind
## 32      6   1  42.12931 286.0000  8.6 78.0       mild Slow Wind
## 33      6   2  42.12931 287.0000  9.7 74.0       Cool Slow Wind
## 34      6   3  42.12931 242.0000 16.1 67.0       Cool     Windy
## 35      6   4  42.12931 186.0000  9.2 84.0       mild Slow Wind
## 36      6   5  42.12931 220.0000  8.6 85.0        Hot Slow Wind
## 37      6   6  42.12931 264.0000 14.3 79.0       mild    Breezy
## 38      6   7  29.00000 127.0000  9.7 82.0       mild Slow Wind
## 39      6   8  42.12931 273.0000  6.9 87.0        Hot Slow Wind
## 40      6   9  71.00000 291.0000 13.8 90.0        Hot    Breezy
## 41      6  10  39.00000 323.0000 11.5 87.0        Hot    Breezy
## 42      6  11  42.12931 259.0000 10.9 93.0        Hot    Breezy
## 43      6  12  42.12931 250.0000  9.2 92.0        Hot Slow Wind
## 44      6  13  23.00000 148.0000  8.0 82.0       mild Slow Wind
## 45      6  14  42.12931 332.0000 13.8 80.0       mild    Breezy
## 46      6  15  42.12931 322.0000 11.5 79.0       mild    Breezy
## 47      6  16  21.00000 191.0000 14.9 77.0       mild    Breezy
## 48      6  17  37.00000 284.0000 20.7 72.0       Cool     Storm
## 49      6  18  20.00000  37.0000 11.5 65.0       Cool    Breezy
## 50      6  19  12.00000 120.0000 11.5 73.0       Cool    Breezy
## 51      6  20  13.00000 137.0000 10.3 76.0       mild    Breezy
## 52      6  21  42.12931 150.0000  6.3 77.0       mild Slow Wind
## 53      6  22  42.12931  59.0000  1.7 76.0       mild     Still
## 54      6  23  42.12931  91.0000  4.6 76.0       mild     Still
## 55      6  24  42.12931 250.0000  6.3 76.0       mild Slow Wind
## 56      6  25  42.12931 135.0000  8.0 77.0       mild Slow Wind
## 57      6  26  42.12931 127.0000  8.0 78.0       mild Slow Wind
## 58      6  27  42.12931  47.0000 10.3 73.0       Cool    Breezy
## 59      6  28  42.12931  98.0000 11.5 80.0       mild    Breezy
## 60      6  29  42.12931  31.0000 14.9 77.0       mild    Breezy
## 61      6  30  42.12931 138.0000  8.0 83.0       mild Slow Wind
## 62      7   1 135.00000 269.0000  4.1 84.0       mild     Still
## 63      7   2  49.00000 248.0000  9.2 85.0        Hot Slow Wind
## 64      7   3  32.00000 236.0000  9.2 81.0       mild Slow Wind
## 65      7   4  42.12931 101.0000 10.9 84.0       mild    Breezy
## 66      7   5  64.00000 175.0000  4.6 83.0       mild     Still
## 67      7   6  40.00000 314.0000 10.9 83.0       mild    Breezy
## 68      7   7  77.00000 276.0000  5.1 88.0        Hot Slow Wind
## 69      7   8  97.00000 267.0000  6.3 92.0        Hot Slow Wind
## 70      7   9  97.00000 272.0000  5.7 92.0        Hot Slow Wind
## 71      7  10  85.00000 175.0000  7.4 89.0        Hot Slow Wind
## 72      7  11  42.12931 139.0000  8.6 82.0       mild Slow Wind
## 73      7  12  10.00000 264.0000 14.3 73.0       Cool    Breezy
## 74      7  13  27.00000 175.0000 14.9 81.0       mild    Breezy
## 75      7  14  42.12931 291.0000 14.9 91.0        Hot    Breezy
## 76      7  15   7.00000  48.0000 14.3 80.0       mild    Breezy
## 77      7  16  48.00000 260.0000  6.9 81.0       mild Slow Wind
## 78      7  17  35.00000 274.0000 10.3 82.0       mild    Breezy
## 79      7  18  61.00000 285.0000  6.3 84.0       mild Slow Wind
## 80      7  19  79.00000 187.0000  5.1 87.0        Hot Slow Wind
## 81      7  20  63.00000 220.0000 11.5 85.0        Hot    Breezy
## 82      7  21  16.00000   7.0000  6.9 74.0       Cool Slow Wind
## 83      7  22  42.12931 258.0000  9.7 81.0       mild Slow Wind
## 84      7  23  42.12931 295.0000 11.5 82.0       mild    Breezy
## 85      7  24  80.00000 294.0000  8.6 86.0        Hot Slow Wind
## 86      7  25 108.00000 223.0000  8.0 85.0        Hot Slow Wind
## 87      7  26  20.00000  81.0000  8.6 82.0       mild Slow Wind
## 88      7  27  52.00000  82.0000 12.0 86.0        Hot    Breezy
## 89      7  28  82.00000 213.0000  7.4 88.0        Hot Slow Wind
## 90      7  29  50.00000 275.0000  7.4 86.0        Hot Slow Wind
## 91      7  30  64.00000 253.0000  7.4 83.0       mild Slow Wind
## 92      7  31  59.00000 254.0000  9.2 81.0       mild Slow Wind
## 93      8   1  39.00000  83.0000  6.9 81.0       mild Slow Wind
## 94      8   2   9.00000  24.0000 13.8 81.0       mild    Breezy
## 95      8   3  16.00000  77.0000  7.4 82.0       mild Slow Wind
## 96      8   4  78.00000 185.9315  6.9 86.0        Hot Slow Wind
## 97      8   5  35.00000 185.9315  7.4 85.0        Hot Slow Wind
## 98      8   6  66.00000 185.9315  4.6 87.0        Hot     Still
## 99      8   7 122.00000 255.0000  4.0 89.0        Hot     Still
## 100     8   8  89.00000 229.0000 10.3 90.0        Hot    Breezy
## 101     8   9 110.00000 207.0000  8.0 90.0        Hot Slow Wind
## 102     8  10  42.12931 222.0000  8.6 92.0        Hot Slow Wind
## 103     8  11  42.12931 137.0000 11.5 86.0        Hot    Breezy
## 104     8  12  44.00000 192.0000 11.5 86.0        Hot    Breezy
## 105     8  13  28.00000 273.0000 11.5 82.0       mild    Breezy
## 106     8  14  65.00000 157.0000  9.7 80.0       mild Slow Wind
## 107     8  15  42.12931  64.0000 11.5 79.0       mild    Breezy
## 108     8  16  22.00000  71.0000 10.3 77.0       mild    Breezy
## 109     8  17  59.00000  51.0000  6.3 79.0       mild Slow Wind
## 110     8  18  23.00000 115.0000  7.4 76.0       mild Slow Wind
## 111     8  19  31.00000 244.0000 10.9 78.0       mild    Breezy
## 112     8  20  44.00000 190.0000 10.3 78.0       mild    Breezy
## 113     8  21  21.00000 259.0000 15.5 77.0       mild     Windy
## 114     8  22   9.00000  36.0000 14.3 72.0       Cool    Breezy
## 115     8  23  42.12931 255.0000 12.6 75.0       mild    Breezy
## 116     8  24  45.00000 212.0000  9.7 79.0       mild Slow Wind
## 117     8  25 168.00000 238.0000  3.4 81.0       mild     Still
## 118     8  26  73.00000 215.0000  8.0 86.0        Hot Slow Wind
## 119     8  27  42.12931 153.0000  5.7 88.0        Hot Slow Wind
## 120     8  28  76.00000 203.0000  9.7 97.0   Very Hot Slow Wind
## 121     8  29 118.00000 225.0000  2.3 94.0        Hot     Still
## 122     8  30  84.00000 237.0000  6.3 96.0   Very Hot Slow Wind
## 123     8  31  85.00000 188.0000  6.3 94.0        Hot Slow Wind
## 124     9   1  96.00000 167.0000  6.9 91.0        Hot Slow Wind
## 125     9   2  78.00000 197.0000  5.1 92.0        Hot Slow Wind
## 126     9   3  73.00000 183.0000  2.8 93.0        Hot     Still
## 127     9   4  91.00000 189.0000  4.6 93.0        Hot     Still
## 128     9   5  47.00000  95.0000  7.4 87.0        Hot Slow Wind
## 129     9   6  32.00000  92.0000 15.5 84.0       mild     Windy
## 130     9   7  20.00000 252.0000 10.9 80.0       mild    Breezy
## 131     9   8  23.00000 220.0000 10.3 78.0       mild    Breezy
## 132     9   9  21.00000 230.0000 10.9 75.0       mild    Breezy
## 133     9  10  24.00000 259.0000  9.7 73.0       Cool Slow Wind
## 134     9  11  44.00000 236.0000 14.9 81.0       mild    Breezy
## 135     9  12  21.00000 259.0000 15.5 76.0       mild     Windy
## 136     9  13  28.00000 238.0000  6.3 77.0       mild Slow Wind
## 137     9  14   9.00000  24.0000 10.9 71.0       Cool    Breezy
## 138     9  15  13.00000 112.0000 11.5 71.0       Cool    Breezy
## 139     9  16  46.00000 237.0000  6.9 78.0       mild Slow Wind
## 140     9  17  18.00000 224.0000 13.8 67.0       Cool    Breezy
## 141     9  18  13.00000  27.0000 10.3 76.0       mild    Breezy
## 142     9  19  24.00000 238.0000 10.3 68.0       Cool    Breezy
## 143     9  20  16.00000 201.0000  8.0 82.0       mild Slow Wind
## 144     9  21  13.00000 238.0000 12.6 64.0       Cold    Breezy
## 145     9  22  23.00000  14.0000  9.2 71.0       Cool Slow Wind
## 146     9  23  36.00000 139.0000 10.3 81.0       mild    Breezy
## 147     9  24   7.00000  49.0000 10.3 69.0       Cool    Breezy
## 148     9  25  14.00000  20.0000 16.6 63.0       Cold     Windy
## 149     9  26  30.00000 193.0000  6.9 70.0       Cool Slow Wind
## 150     9  27  42.12931 145.0000 13.2 77.0       mild    Breezy
## 151     9  28  14.00000 191.0000 14.3 75.0       mild    Breezy
## 152     9  29  18.00000 131.0000  8.0 76.0       mild Slow Wind
## 153     9  30  20.00000 223.0000  8.0 68.0       Cool Slow Wind
##          WeatherStatus
## 1       Cool Slow Wind
## 2          Cool Breezy
## 3          Cool Breezy
## 4          Cold Breezy
## 5          Cold Breezy
## 6          Cool Breezy
## 7       Cool Slow Wind
## 8          Cold Breezy
## 9           Cold Storm
## 10      Cool Slow Wind
## 11      Cool Slow Wind
## 12      Cool Slow Wind
## 13      Cool Slow Wind
## 14         Cool Breezy
## 15         Cold Breezy
## 16         Cold Breezy
## 17         Cool Breezy
## 18          Cold Windy
## 19         Cool Breezy
## 20      Cold Slow Wind
## 21      Cold Slow Wind
## 22          Cool Windy
## 23      Cold Slow Wind
## 24         Cold Breezy
## 25          Cold Windy
## 26         Cold Breezy
## 27      Cold Slow Wind
## 28         Cool Breezy
## 29         mild Breezy
## 30      mild Slow Wind
## 31      mild Slow Wind
## 32      mild Slow Wind
## 33      Cool Slow Wind
## 34          Cool Windy
## 35      mild Slow Wind
## 36       Hot Slow Wind
## 37         mild Breezy
## 38      mild Slow Wind
## 39       Hot Slow Wind
## 40          Hot Breezy
## 41          Hot Breezy
## 42          Hot Breezy
## 43       Hot Slow Wind
## 44      mild Slow Wind
## 45         mild Breezy
## 46         mild Breezy
## 47         mild Breezy
## 48          Cool Storm
## 49         Cool Breezy
## 50         Cool Breezy
## 51         mild Breezy
## 52      mild Slow Wind
## 53          mild Still
## 54          mild Still
## 55      mild Slow Wind
## 56      mild Slow Wind
## 57      mild Slow Wind
## 58         Cool Breezy
## 59         mild Breezy
## 60         mild Breezy
## 61      mild Slow Wind
## 62          mild Still
## 63       Hot Slow Wind
## 64      mild Slow Wind
## 65         mild Breezy
## 66          mild Still
## 67         mild Breezy
## 68       Hot Slow Wind
## 69       Hot Slow Wind
## 70       Hot Slow Wind
## 71       Hot Slow Wind
## 72      mild Slow Wind
## 73         Cool Breezy
## 74         mild Breezy
## 75          Hot Breezy
## 76         mild Breezy
## 77      mild Slow Wind
## 78         mild Breezy
## 79      mild Slow Wind
## 80       Hot Slow Wind
## 81          Hot Breezy
## 82      Cool Slow Wind
## 83      mild Slow Wind
## 84         mild Breezy
## 85       Hot Slow Wind
## 86       Hot Slow Wind
## 87      mild Slow Wind
## 88          Hot Breezy
## 89       Hot Slow Wind
## 90       Hot Slow Wind
## 91      mild Slow Wind
## 92      mild Slow Wind
## 93      mild Slow Wind
## 94         mild Breezy
## 95      mild Slow Wind
## 96       Hot Slow Wind
## 97       Hot Slow Wind
## 98           Hot Still
## 99           Hot Still
## 100         Hot Breezy
## 101      Hot Slow Wind
## 102      Hot Slow Wind
## 103         Hot Breezy
## 104         Hot Breezy
## 105        mild Breezy
## 106     mild Slow Wind
## 107        mild Breezy
## 108        mild Breezy
## 109     mild Slow Wind
## 110     mild Slow Wind
## 111        mild Breezy
## 112        mild Breezy
## 113         mild Windy
## 114        Cool Breezy
## 115        mild Breezy
## 116     mild Slow Wind
## 117         mild Still
## 118      Hot Slow Wind
## 119      Hot Slow Wind
## 120 Very Hot Slow Wind
## 121          Hot Still
## 122 Very Hot Slow Wind
## 123      Hot Slow Wind
## 124      Hot Slow Wind
## 125      Hot Slow Wind
## 126          Hot Still
## 127          Hot Still
## 128      Hot Slow Wind
## 129         mild Windy
## 130        mild Breezy
## 131        mild Breezy
## 132        mild Breezy
## 133     Cool Slow Wind
## 134        mild Breezy
## 135         mild Windy
## 136     mild Slow Wind
## 137        Cool Breezy
## 138        Cool Breezy
## 139     mild Slow Wind
## 140        Cool Breezy
## 141        mild Breezy
## 142        Cool Breezy
## 143     mild Slow Wind
## 144        Cold Breezy
## 145     Cool Slow Wind
## 146        mild Breezy
## 147        Cool Breezy
## 148         Cold Windy
## 149     Cool Slow Wind
## 150        mild Breezy
## 151        mild Breezy
## 152     mild Slow Wind
## 153     Cool Slow Wind
  1. Descriptive Analysis
#Show the Minimum, Average & Maximum for Ozone for the 5th month
min(filter(dfrW,Month == 5)$Ozone)
## [1] 1
mean(filter(dfrW,Month == 5)$Ozone)
## [1] 26.6015
max(filter(dfrW,Month == 5)$Ozone)
## [1] 115
#Show the Minimum, Average & Maximum for Solar for the 6th month
min(filter(dfrW,Month == 6)$Ozone)
## [1] 12
mean(filter(dfrW,Month == 6)$Ozone)
## [1] 38.32385
max(filter(dfrW,Month == 6)$Ozone)
## [1] 71
#Show the Minimum, Average & Maximum for Wind for the 7th month
min(filter(dfrW,Month == 7)$Ozone)
## [1] 7
mean(filter(dfrW,Month == 7)$Ozone)
## [1] 56.3757
max(filter(dfrW,Month == 7)$Ozone)
## [1] 135
#Show the Minimum, Average & Maximum for Temp for the 8th month 
min(filter(dfrW,Month == 7)$Ozone)
## [1] 7
mean(filter(dfrW,Month == 7)$Ozone)
## [1] 56.3757
max(filter(dfrW,Month == 7)$Ozone)
## [1] 135