This document want to show the which type of the storm event have the strongest effect on the USA cost
Which event have the largest Crop cost?
Which event have the largest Property cost?
Which event have the largest total cost?
7/6/2020
This document want to show the which type of the storm event have the strongest effect on the USA cost
Which event have the largest Crop cost?
Which event have the largest Property cost?
Which event have the largest total cost?
suppressPackageStartupMessages(library(ggplot2)) suppressPackageStartupMessages(library(plotly))
## Warning: package 'plotly' was built under R version 3.6.2
We group the cost with respect to different groups:
dat = read.csv("StormEvents_2018.csv")
dat = dat[,c("Event_Type","Property_Cost","Crop_Cost")]
suppressPackageStartupMessages(library(dplyr))
datt = dat %>%
group_by(Event_Type) %>%
summarise(Crop = sum(Crop_Cost,na.rm = TRUE),
Prop = sum(Property_Cost,na.rm = TRUE),
Total = Prop + Crop)
From the plot, we can see that the Hurricane have the largeset effect on the crop cost.
From the plot, we can see that the Wildfire have the largeset effect on the crop cost.
As a result, Wildfire has the largest effect on the cost in 2018 in US