-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added basic schedule and website structure
- Loading branch information
1 parent
78e11bb
commit 05b77a7
Showing
22 changed files
with
2,182 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Assignment, Due, Moodle, File, Marks | ||
Assignment 1, 2024-03-22, ????, "A1.qmd", 25 | ||
Assignment 2, 2024-04-05, ????, "A2.qmd", 25 | ||
Assignment 3, 2024-05-03, ????, "A3.qmd", 20 | ||
Assignment 4, 2024-06-01, ????, "A4.qmd", 30 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- | ||
title: Assignment 1 (25%) | ||
--- | ||
|
||
> Create package skeleton. Include a basic function from set of options | ||
```{r} | ||
#| output: asis | ||
source(here::here("course_info.R")) | ||
submit(schedule, "Assignment 1") | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- | ||
title: Assignment 2 (25%) | ||
--- | ||
|
||
> Give bad broken complicated function for their package, fix it thanks Write tests and docs Explain why it doesn’t work and is now better | ||
```{r} | ||
#| output: asis | ||
source(here::here("course_info.R")) | ||
submit(schedule, "Assignment 2") | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- | ||
title: Assignment 3 (20%) | ||
--- | ||
|
||
> Use package within larger quarto targets workflow Uses broken function from A2 | ||
```{r} | ||
#| output: asis | ||
source(here::here("course_info.R")) | ||
submit(schedule, "Assignment 3") | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- | ||
title: Assignment 4 (30%) | ||
--- | ||
|
||
> Extend A1 package with object-oriented Extend tidyverse with some tidy interfacesInstructions | ||
```{r} | ||
#| output: asis | ||
source(here::here("course_info.R")) | ||
submit(schedule, "Assignment 4") | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,120 @@ | ||
######## Course info ######## | ||
library(tidyverse) | ||
|
||
# Start of semester | ||
start_semester <- "2024-02-26" | ||
|
||
# Week of mid-semester break | ||
mid_semester_break <- "2024-04-01" | ||
|
||
# Schedule | ||
schedule <- tibble( | ||
Week = seq(12), | ||
Topic = c( | ||
"Foundations of R programming", | ||
"R package development", | ||
"R package development", | ||
"Debugging and profiling", | ||
"Functional programming", | ||
"Object-oriented programming", | ||
"Reactive programming: shiny", | ||
"Reactive programming: targets", | ||
"Metaprogramming", | ||
"Metaprogramming", | ||
"Rewriting R code in C++", | ||
"Interfacing with other languages" | ||
), | ||
Reference = c( | ||
"1-8. *Advanced R*", | ||
"*R Packages*", | ||
"*R Packages*", | ||
"22-24. *Advanced R*", | ||
"9-11. *Advanced R*", | ||
"12-13. *Advanced R*", | ||
"*Mastering Shiny*", | ||
"*The {targets} R package user manual*", | ||
"17-20. *Advanced R*", | ||
"17-20. *Advanced R*", | ||
"25. *Advanced R*", | ||
"21. *Advanced R*" | ||
), | ||
Reference_URL = c( | ||
"https://adv-r.hadley.nz/foundations-intro.html", | ||
"https://r-pkgs.org", | ||
"https://r-pkgs.org", | ||
"https://adv-r.hadley.nz/debugging.html", | ||
"https://adv-r.hadley.nz/fp.html", | ||
"https://adv-r.hadley.nz/oo.html", | ||
"https://mastering-shiny.org", | ||
"https://books.ropensci.org/targets/", | ||
"https://adv-r.hadley.nz/metaprogramming.html", | ||
"https://adv-r.hadley.nz/metaprogramming.html", | ||
"https://adv-r.hadley.nz/rcpp.html", | ||
"https://adv-r.hadley.nz/translation.html" | ||
) | ||
) | ||
|
||
# Add mid-semester break | ||
calendar <- tibble( | ||
Date = seq(as.Date(start_semester), by = "1 week", length.out = 13) | ||
) |> | ||
mutate( | ||
Week = row_number(), | ||
Week = if_else(Date < mid_semester_break, Week, Week - 1), | ||
#Week = | ||
) | ||
|
||
# Add calendar to schedule | ||
schedule <- schedule |> | ||
left_join(calendar, by = "Week") |> | ||
mutate( | ||
Week = if_else(Date == mid_semester_break, NA, Week), | ||
Topic = if_else(Date == mid_semester_break, "Mid-semester break", Topic), | ||
Reference = if_else(Date == mid_semester_break, NA, Reference), | ||
Reference_URL = if_else(Date == mid_semester_break, NA, Reference_URL) | ||
) |> | ||
select(Week, Date, everything()) | ||
|
||
# Add assignment details | ||
lastmon <- function(x) { | ||
7 * floor(as.numeric(x-1+4)/7) + as.Date(1-4, origin="1970-01-01") | ||
} | ||
|
||
assignments <- read_csv(here::here("assignments.csv")) |> | ||
mutate( | ||
Date = lastmon(Due), | ||
Moodle = paste0("https://learning.monash.edu/mod/assign/view.php?id=", Moodle), | ||
File = paste0("assignments/", File) | ||
) | ||
|
||
schedule <- schedule |> | ||
full_join(assignments, by = "Date") |> | ||
mutate(Week = if_else(is.na(Week) & Date > "2024-05-20", 13, Week)) | ||
|
||
show_assignments <- function(week) { | ||
ass <- schedule |> | ||
filter( | ||
Week >= week & (week > Week - 3 | week > 8), | ||
!is.na(Assignment), | ||
) |> | ||
select(Assignment:File) | ||
if(NROW(ass) > 0) { | ||
cat("\n\n## Assignments\n\n") | ||
for(i in seq(NROW(ass))) { | ||
cat("* [", ass$Assignment[i], "](../", ass$File[i], ") is due on ", | ||
format(ass$Due[i], "%A %d %B.\n"), sep="") | ||
} | ||
} | ||
} | ||
|
||
|
||
submit <- function(schedule, assignment) { | ||
ass <- schedule |> | ||
filter(Assignment == assignment) | ||
due <- format(ass$Due, "%e %B %Y") |> stringr::str_trim() | ||
url <- ass$Moodle | ||
button <- paste0("<br><br><hr><b>Due: ", due, "</b><br>", | ||
"<a href=",url," class = 'badge badge-large badge-blue'>", | ||
"<font size='+2'> <b>Submit</b> </font><br></a>") | ||
cat(button) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,13 +2,67 @@ | |
title: "ETC4500/5450 Advanced R Programming" | ||
--- | ||
|
||
R is widely used as a tool for data analysis and one of the most popular programming languages. This unit delves into R from the programming aspect instead of using it as a data analysis tool. You will learn a variety of programming paradigms and delve into the foundations of R as a programming language. | ||
|
||
## Learning outcomes | ||
|
||
1. be familiar with the foundations of R programming | ||
2. understand a variety of programming paradigms, including functional programming and object-oriented programming | ||
3. utilise R’s functional and object-oriented programming systems | ||
4. integrate the concept of metaprogramming to evaluate and construct new functions | ||
|
||
## Teachers | ||
|
||
* [**Rob J Hyndman**](https://robjhyndman.com). Email: [[email protected]](mailto:[email protected]) | ||
* [**Rob J Hyndman**](https://robjhyndman.com). Chief Examiner. Email: [[email protected]](mailto:[email protected]) | ||
* [**Mitchell O'Hara-Wild**](https://mitchelloharawild.com). Email: [[email protected]](mailto:[email protected]) | ||
* [**Thomas Lumley**](https://profiles.auckland.ac.nz/t-lumley). (Week 6?) | ||
* [**Tomasz Wozniak**](https://github.com/donotdespair). (Week 11) | ||
|
||
## References | ||
|
||
* [Advanced R, 2e](https://adv-r.hadley.nz/) by Hadley Wickham. | ||
* [R packages, 2e](http://r-pkgs.org/) by Hadley Wickham & Jenny Bryan. | ||
* [Targets user manual](https://books.ropensci.org/targets/) by Will Landau. | ||
* [*Advanced R*, 2e](https://adv-r.hadley.nz/) by Hadley Wickham. | ||
* [*R packages*, 2e](http://r-pkgs.org/) by Hadley Wickham & Jenny Bryan. | ||
* [*Mastering Shiny*](https://mastering-shiny.org/) by Hadley Wickham. | ||
* [*The {targets} R package user manual*](https://books.ropensci.org/targets/) by Will Landau. | ||
|
||
```{r} | ||
#| label: load_packages | ||
#| include: false | ||
#| message: false | ||
#| warning: false | ||
#| echo: false | ||
#| cache: false | ||
library(tidyverse) | ||
options(knitr.kable.NA = '') | ||
source(here::here("course_info.R")) | ||
week <- as.integer(1 + ((Sys.Date() - as_date(start_semester))/7)) | ||
``` | ||
|
||
## Weekly schedule | ||
|
||
* Workshop: 2 hours in class per week | ||
|
||
```{r} | ||
#| label: schedule2 | ||
#| message: false | ||
#| warning: false | ||
#| echo: false | ||
#| output: asis | ||
schedule |> | ||
transmute( | ||
Date = format(Date+1, "%d %b"), | ||
Show = !is.na(Week) & Week <= 12, | ||
Topic = if_else(!Show, Topic, glue::glue("[{Topic}](./week{Week}/index.html)")), | ||
Reference = if_else(!Show, Reference, glue::glue("[{Reference}]({Reference_URL})")), | ||
Assessments = if_else(is.na(Assignment), Assignment, glue::glue("[{Assignment}]({File})")) | ||
) |> | ||
select(-Show) |> | ||
knitr::kable(format = "markdown") | ||
``` | ||
|
||
## Assessments | ||
|
||
* Make an R package (25%) | ||
* Fix a broken function (25%) | ||
* Use your package within a quarto targets workflow (20%) | ||
* Advanced package and metaprogramming methods (30%) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.