Make a new folder in your course folder for the exercise (e.g. biob11/exercise_10)
Open RStudio
If you haven’t closed RStudio since the last exercise, I recommend you do so and then re-open it. If it asks if you want to save your R Session data, choose no.
Set your working directory by going to Session -> Set working directory -> Choose directory, then navigate to the folder you just made for this exercise.
Create a new Rmarkdown document (File -> New file -> R markdown..). Give it a clear title.
Please ensure you have followed the step above before you start!
Lake ice coverage and air temperature
This dataset contains records of ice formation on two lakes (lakeid) since the mid 1800s. The ice_on date refers to the first day in the winter of year where the lake fully froze, and ice_off refers to the date the following spring where the ice fully melted. avg_air_temp_adjusted is the mean temperature during the winter of year.
Use this dataset to answer these broad research questions:
Has the total amount of time each lake spends frozen each winter changed?
Is this change associated with air temperature?
In general, does one lake stay frozen for longer than the other?
Remember:
State clearly the research question, and what your hypotheses were. Explain why these hypotheses answer your research question.
Explain your choice of test statistic/method. Relate this to your hypotheses and question.
State your observed statistics(s) and confidence intervals. Explain what these mean. Refer to plots you have made.
State the outcome of your hypothesis test (quoting test statistIc(s) and p-values). Interpret this result, in both terms of your statistical hypothesis, but also the broad research question.
Hint about dates in R
library(tidyverse, quietly =TRUE)
── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
✔ dplyr 1.1.4 ✔ readr 2.1.5
✔ forcats 1.0.0 ✔ stringr 1.5.1
✔ ggplot2 3.5.1 ✔ tibble 3.2.1
✔ lubridate 1.9.3 ✔ tidyr 1.3.1
✔ purrr 1.0.2
── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
✖ dplyr::filter() masks stats::filter()
✖ dplyr::lag() masks stats::lag()
ℹ Use the conflicted package (<http://conflicted.r-lib.org/>) to force all conflicts to become errors