7/6/2020

Introduction

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?

Library Setup

suppressPackageStartupMessages(library(ggplot2))
suppressPackageStartupMessages(library(plotly))
## Warning: package 'plotly' was built under R version 3.6.2

Read data:

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)

Plotting the largest Crop cost:

From the plot, we can see that the Hurricane have the largeset effect on the crop cost.

Ploting the Largest the Property Cost:

From the plot, we can see that the Wildfire have the largeset effect on the crop cost.

Ploting the Largest the Total Cost:

As a result, Wildfire has the largest effect on the cost in 2018 in US