Please submit to your given dropbox. Submit both the markdown or quarto file and html. Extra credit for using github. See the Rmarkdown Cheat Sheet here and the Quarto Cheat Sheet here

Let’s explore the dataset quakes looking at earthquakes off of Fiji.

  1. Load quakes with data(quakes). Show what’s there with str() and summary(). What do you see?

  2. Show the entirety of the column long.

  3. Hey, another useful function - unique()! Apply it to a vector, and you can see what are all of the unique values. It’s great for really digging into a problematic vector.

What unique stations are there? Use length() with unique() to determine how many stations there are.

  1. Using range(), what is the range of depths where quakes occur?

Impress Yourself. Where was the earthquake of largest magnitude found? You’ll need to use come comparisons and the max() function for this in your indices instead of a number!

A Little LaTeX

In the future, we’ll be writing some equations. Quarto is great in that it allows you to use LaTeX syntax for equations. You simply use the LaTeX notation and wrap it in $ or $$ at the start and end. For a quick intro, see here or here. I often refer to this reference or this online LaTeX equation builder when I get lost.

  1. Take it for a test drive. Put the following equation in your markdown: \(x = \mu\)

  2. What’s the difference between wrapping your equation in $ versus $$? Show an example with \(Y_i = 3 X_i\) done both ways.

  3. Try out superscripts. Code up \(a^2 = b^2 + c^2\)

Impress Yourself. Write out the notation for a normal distribution that looks like so.

\[y_i \sim \mathcal{N}(\hat{y_i}, \sigma^2)\]

Note, if that N looks like a box, right click on the equation and change your math renderer to Common HTML.


Meta 1. For some of you, this week was your first experience with R (or even programming at all) - how did it feel to connect concepts to a novel set of problems. For those who have experience with R, was this a cakewalk or challenging? How did it feel to shake off the cobwebs?

Meta 2. Sometimes I throw in new concepts in homework that I expect you to look into a little bit, like the LaTeX. It’s something small enough that I think you can do it outside of class. How was the LaTeX part of the homework for you? Do you see its future application?

Meta 3. How much time did this take you, roughly?

Meta 4. Please give yourself a weak/sufficient/strong assessment on this assigment. Feel free to comment on why.