-
Notifications
You must be signed in to change notification settings - Fork 3
/
_deleteme.qmd
116 lines (74 loc) · 2.29 KB
/
_deleteme.qmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
---
title: "Transformations and Non-Linear Models"
subtitle: "Chapter 5: Lesson 4"
format: html
editor: source
sidebar: false
---
```{r}
#| include: false
source("common_functions.R")
```
```{=html}
<script type="text/javascript">
function showhide(id) {
var e = document.getElementById(id);
e.style.display = (e.style.display == 'block') ? 'none' : 'block';
}
function openTab(evt, tabName) {
var i, tabcontent, tablinks;
tabcontent = document.getElementsByClassName("tabcontent");
for (i = 0; i < tabcontent.length; i++) {
tabcontent[i].style.display = "none";
}
tablinks = document.getElementsByClassName("tablinks");
for (i = 0; i < tablinks.length; i++) {
tablinks[i].className = tablinks[i].className.replace(" active", "");
}
document.getElementById(tabName).style.display = "block";
evt.currentTarget.className += " active";
}
</script>
```
## Learning Outcomes
{{< include outcomes/chapter_5_lesson_4_outcomes.qmd >}}
## Preparation
- Read Sections 5.7-5.8
## Learning Journal Exchange (10 min)
- Review another student's journal
- What would you add to your learning journal after reading another student's?
- What would you recommend the other student add to their learning journal?
- Sign the Learning Journal review sheet for your peer
<!-- {{< include _packages.qmd >}} -->
# Temperature - England
```{r}
temp_eng_ts <- rio::import("data/temperature_england.csv") |>
dplyr::select(-comments) |>
pivot_longer(cols = c(-Year), names_to = "month_abbrev", values_to = "temp_c") |>
mutate(month = my(paste(month_abbrev, Year))) |>
filter(temp_c > -99.9 & Year >= 1970) |>
dplyr::select(month, temp_c) |>
as_tsibble(index = month)
```
```{r}
temp_eng_ts |>
autoplot(.vars = temp_c) +
labs(
x = "Month",
y = "Temperature in Central England (Celsius)",
title = "Temperature Record from Central England"
) +
theme_minimal() +
theme(plot.title = element_text(hjust = 0.5))
```
```{r}
temp_eng_ts |>
autoplot(.vars = log(temp_c)) +
labs(
x = "Quarter",
y = "Log of Revenue (Billions of U.S. Dollars)",
title = "Logarithm of Apple Revenue in Billions of U.S. Dollars"
) +
theme_minimal() +
theme(plot.title = element_text(hjust = 0.5))
```