You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+1-3Lines changed: 1 addition & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -11,7 +11,5 @@ The NOAA Storm Database receives Storm Data from the National Weather Service fr
11
11
12
12
This work was done as a part of a project towards the completion of the [Reproducible Research](http://www.coursera.org/learn/reproducible-research) course in the [Data Science Specialization](http://www.coursera.org/specializations/jhu-data-science). This `knitr` generated publication documents all the work done (in R) towards the completion of said project.
13
13
14
+
-------------------------
14
15
**Read the full [data documentation](https://d396qusza40orc.cloudfront.net/repdata%2Fpeer2_doc%2Fpd01016005curr.pdf)**
15
-
16
-
-----------------
17
-
*Done towards the completion of the [Reproducible Research](https://www.coursera.org/learn/reproducible-research) course by Johns Hopkins University.*
```{r image-render, echo=FALSE, fig.align="center", fig.width=6, cache=TRUE, fig.cap="A photo of Hurricane Florence taken from the ISS (Courtesy: NASA)"}
18
20
library(jpeg)
19
21
library(grid)
20
22
img <- readJPEG("hurriet-pasha.jpg")
@@ -40,8 +42,8 @@ library(knitr)
40
42
library(xtable)
41
43
library(magrittr)
42
44
library(data.table)
43
-
library(rapportools)
44
-
library(wesanderson)
45
+
library(waffle)
46
+
library(RColorBrewer)
45
47
46
48
knitr::opts_chunk$set(
47
49
fig.align = "center",
@@ -128,7 +130,7 @@ unique(dmg$CROPDMGEXP)
128
130
Corresponding to each unique symbol, we need to assign a numeric value. Let's create key-value pairs with our assigned exponents as values to facilitate our transition from this current state (shown [here](#curr)) to [this](#ideal).
*NOTE:* Using `mutate_at` along with a key-value fetcher function for this task doesn't work as intended and instead, copies the same values across all rows.
175
+
*NOTE:* Using `mutate_at` along with a key-value fetcher function for this task didn't work as intended and instead, copied the same values across all rows. This is why it was avoided in this chunk.
174
176
175
177
### 4. Use `mutate` to create columns for `PropertyDamage`, `CropDamage` and `TotalDamage` and get rid of the raw column data
While a bar plot pretty much nails it when it comes to comparing events on absolute terms, a relative comparison of Total Losses using a "Waffle" Chart might be better for most situations.
278
+
The data for Casualties is pretty clear on what the major contributor to weather-event related deaths is with Tornados taking a sizeable lead over the rest in both Injuries as well as Fatalities. The following four events are tied pretty evenly with each other while the events further down the list start appearing progressively insignificant next to one another.
274
279
275
-
First, re-abbreviate the data to only include the Total Losses of each category
280
+
On the other hand, the data on Economic Costs a steady progression a la [Zipf's Law](https://en.wikipedia.org/wiki/Zipf%27s_law) with Floods still holding an indisputable lead over damages to Property and Crops with Typhoon and Tornados (no less) not very far behind. Interestingly, one may also notice that a few Events show extreme selectivity towards one type of Economic Resource. Upon closer inspection, however, it seems obvious why.
This work was done as a part of a project towards the completion of the [Reproducible Research](http://www.coursera.org/learn/reproducible-research) course in the [Data Science Specialization](http://www.coursera.org/specializations/jhu-data-science).
283
285
284
-
```
286
+
Keeping focus and familiarity in mind,I went with the `readthedocs`-esque layout available for `Rmd` courtesy of [juba](https://github.com/juba/rmdformats). I've made my full code available on [github](https://github.com/RexGalilae/Weather-Data-Rmd). If there are any suggestions, feel free to make them `r emo::ji("smile")`
This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see <http://rmarkdown.rstudio.com>.
25
+
26
+
When you click the **Knit** button a document will be generated that includes both content as well as the output of any embedded R code chunks within the document. You can embed an R code chunk like this:
27
+
28
+
```{r cars}
29
+
summary(cars)
30
+
```
31
+
32
+
## Including Plots
33
+
34
+
You can also embed plots, for example:
35
+
36
+
```{r pressure, echo=FALSE}
37
+
plot(pressure)
38
+
```
39
+
40
+
Note that the `echo = FALSE` parameter was added to the code chunk to prevent printing of the R code that generated the plot.
0 commit comments