Hurricanes in Michigan State & Reporting
Note: Please use the library UScensus2000tract for this assignment
- For missouri.tract dataframe, print the first 30 rows of data.
- Find the datatype of all the columns and comment about the N/A values in each column.
- Find the unique values for at least 5 columns of the above dataset
For the below questions, please use nasaweather library
- Report all the hurricanes in Michigan state occurred in the month of October.
- Provide the names of storms occurred between the years of 1995-97 which occurred after 6 PM and pressure above the first quartile.
Note: Please manipulate data step by step and upload both screenshots and code snippets (.r files)
If you could not find a perfect answer for any of the question, that is totally fine. This is usually a part of the real project. Make sure your provide every trial you make to accomplish the task. If it fails, also show your explanation.
head(missouri.tract@data, 30) ## Question – 1
sapply(missouri.tract@data, typeof) ## Question – 2
sapply(missouri.tract@data[,1:5], unique) ## Question – 3
#### Question – 1
hurricanes = storms[which(storms$type == “Hurricane”),] ## Subsetting for hurricanes
hurricanesInOctober = hurricanes[which(hurricanes$month == “10”),] ## Subsetting for October
hurricanesInOctoberMichigan = hurricanesInOctober[which(hurricanesInOctober$lat > 42 & hurricanesInOctober$lat < 46 & hurricanesInOctober$long > -86, hurricanesInOctober$long < -83),] ## Subsetting for Michigan with approximate latitude longitudes
#### Question – 2
stormsInGivenYears = storms[which(storms$year >= 1995 & storms$year <= 1997),] ## Subsetting for 1995-97
stormsInGivenYearsAfter6 = stormsInGivenYears[which(stormsInGivenYears$hour >= 18),] ## Subsetting after 6 PM
stormsInGivenYearsAfter6PressureAboveFirstQuartile = stormsInGivenYearsAfter6[which(stormsInGivenYearsAfter6$pressure >= as.integer(quantile(storms$pressure))),] ## Subsetting for Pressure