Skip to content

Commit

Permalink
complete solutions
Browse files Browse the repository at this point in the history
  • Loading branch information
ernestguevarra committed Nov 18, 2024
1 parent 4bd2167 commit 1f0d774
Show file tree
Hide file tree
Showing 8 changed files with 1,176 additions and 2 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,7 @@
.Rhistory
.RData
.Ruserdata

/docs/

/.quarto/
23 changes: 23 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,31 @@ Using R, can you show the Q-Q plot for:

* the `speed` variable


## Pop Quiz

A pop quiz was given to the students on the 12th of November 2024 as part of this exercise. The questions to the pop quiz were:

### Question 1
How many cyclones entered the Philippines in 2017?


### Question 2
What is the mean cyclone speed of the cyclones that hit the Philippines in 2019?


### Question 3
What is the name of the cyclone with the lowest pressure in 2020?


### Question 4
How many cyclones have a speed of less than 100 kph and a pressure greater than 1000 hPa?


## Solution

A solutions script named `cyclones.R` is found in this repository. The script provides various possible solutions for each of the tasks above.

A solutions script named `pop_quiz.R` is found in this repository. The script provided various possible solutions for the pop quiz given on the 12th of November 2024.

The solutions can also be viewed as an HTML document that shows the code solutions alongside text that provides step-by-step explanation of what the solution is doing. The HTML document can be read here.
25 changes: 25 additions & 0 deletions _quarto.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
project:
output-dir: docs

format:
html:
toc: true
toc-location: left
toc-depth: 3
highlight-style: breeze
embed-resources: true
grid:
body-width: 900px
margin-width: 300px
code-tools:
source: https://github.com/OxfordIHTM/solutions-depressions-storms-typhoons-oh-my/blob/main/cyclones.qmd
pdf:
documentclass: scrartcl
papersize: a4
toc: true
toc-title: Contents
lof: true
lot: true
number-sections: true
number-depth: 3
highlight-style: breeze
6 changes: 4 additions & 2 deletions cyclones.R
Original file line number Diff line number Diff line change
Expand Up @@ -199,13 +199,15 @@ par(mfcol = c(1, 2)) ## split plotting window to two
hist(
cyclones$pressure[cyclones$speed < 100],
main = NULL,
xlab = "Speed < 100 kph"
xlab = "Speed < 100 kph",
ylim = c(0, 30)
)

hist(
cyclones$pressure[cyclones$speed >= 100],
main = NULL,
xlab = "Speed >= 100 kph"
xlab = "Speed >= 100 kph",
ylim = c(0, 30)
)

par(mfcol = c(1, 1)) ## Return plotting window back to 1 x 1
Expand Down
Loading

0 comments on commit 1f0d774

Please sign in to comment.