In general the data is subset in order to isolate events that have a greater impact. Graphs are created to show the damage to both people and property.
Finally we examine if the events that cause the most damage to people change over time.
library(lattice)
setwd("~/Coursera_DataScience/RR/Pa2")
storm_data <- read.csv("repdata-data-StormData.csv")
storm_data$BGN_DATE <- strptime(storm_data$BGN_DATE, format = "%m/%d/%Y %H:%M:%S")
storm_data$END_DATE <- strptime(storm_data$END_DATE, format = "%m/%d/%Y %H:%M:%S")
storm_data$YEAR <- format(storm_data$BGN_DATE, "%Y")
people_storm_data <- storm_data[storm_data$INJURIES + storm_data$FATALITIES >
100, ]
cost_storm_data <- storm_data[storm_data$PROPDMG + storm_data$CROPDMG > 1000,
]
xyplot(people_storm_data$EVTYPE ~ people_storm_data$INJURIES + people_storm_data$FATALITIES)
xyplot(people_storm_data$EVTYPE ~ people_storm_data$INJURIES + people_storm_data$FATALITIES |
people_storm_data$YEAR)
xyplot(cost_storm_data$EVTYPE ~ cost_storm_data$PROPDMG + cost_storm_data$CROPDMG)