---
title: "STAT 331 Week 5 Day 2 Handout"
format: html
embed-resources: true
---

You will want to open and edit this handout in VISUAL mode.

+---------------------------------------------------+------------------------------------------------------------+---------------------------------+
| **Function**                                      | Example                                                    | **What does this function do?** |
+---------------------------------------------------+------------------------------------------------------------+---------------------------------+
| `make_date(...)`                                  | `make_date(year = 1995, month = 05, day = 08)`             |                                 |
+---------------------------------------------------+------------------------------------------------------------+---------------------------------+
| `mdy(...)`                                        | `mdy("August 29, 1991")`                                   |                                 |
|                                                   |                                                            |                                 |
| `dmy(...)`                                        |                                                            |                                 |
+---------------------------------------------------+------------------------------------------------------------+---------------------------------+
| `dmy_hms(...)`                                    | `dmy_hms("29-August-1991 9:32:12", tz = "America/Denver")` |                                 |
+---------------------------------------------------+------------------------------------------------------------+---------------------------------+
| `year(...)`                                       | `year(bday)`                                               |                                 |
|                                                   |                                                            |                                 |
| `month(...)`                                      | `month(bday)`                                              |                                 |
|                                                   |                                                            |                                 |
| `day(...)`                                        | `day(bday)`                                                |                                 |
+---------------------------------------------------+------------------------------------------------------------+---------------------------------+
| `wday(...,      label = TRUE,      abbr = FALSE)` | `wday(bday, label = TRUE, abbr = FALSE)`                   |                                 |
+---------------------------------------------------+------------------------------------------------------------+---------------------------------+
| `as.duration(...)`                                | `as.duration(today() - mdy("01141989"))`                   |                                 |
+---------------------------------------------------+------------------------------------------------------------+---------------------------------+
| `as.period(...)`                                  | `as.period(today() - mdy("01141989"))`                     |                                 |
+---------------------------------------------------+------------------------------------------------------------+---------------------------------+
| `days(...)`                                       | `date1 + days(...)`                                        |                                 |
|                                                   |                                                            |                                 |
| `years(...)`                                      |                                                            |                                 |
+---------------------------------------------------+------------------------------------------------------------+---------------------------------+
| `interval(...)`                                   | `interval(date1, date2)`                                   |                                 |
+---------------------------------------------------+------------------------------------------------------------+---------------------------------+
| `%within%`                                        | `date3 %within% interval`                                  |                                 |
+---------------------------------------------------+------------------------------------------------------------+---------------------------------+
| `with_tz(...)`                                    | `with_tz(bday, tzone = "Europe/Copenhagen")`               |                                 |
+---------------------------------------------------+------------------------------------------------------------+---------------------------------+
| `force_tz(...)`                                   | `force_tz(bday, tzone = "Europe/Copenhagen")`              |                                 |
+---------------------------------------------------+------------------------------------------------------------+---------------------------------+
