Package Reference
Tip
Load the package each R session:library(mccoursepack)
This page documents the functions students actually use.
All commands assume you are working inside an RStudio Project.
At a glance
Function | What it does |
---|---|
list_courses() |
Lists installed course IDs (e.g., "mc451" , "mc501" ). |
list_weeks(course = NULL) |
Lists available week folders (e.g., "week_01" ) for a course. If NULL , aggregates across all installed courses. |
download_week(course, week, dest = ".") |
Creates week_XX/ under dest and copies that week’s files there. |
open_week(week, dest = ".") |
Opens the local week_XX/ folder in your system’s file browser. |
mccourse_setup(ask = TRUE, pkgs = c(...)) |
One-time helper: installs Quarto, TinyTeX (for PDF), and core CRAN packages if missing. |
mccourse_self_test() |
Prints the courses and weeks the package can see (sanity check). |
mccourse_update() |
Updates mccoursepack to the latest GitHub build. |
list_courses()
list_courses()
Returns a character vector of course IDs (e.g., "mc451"
, "mc501"
). If no courses are installed, returns an empty vector.
list_weeks(course = NULL)
list_weeks() # across all installed courses
list_weeks("mc451") # for a specific course
Returns folder names like "week_01"
, "week_02"
, … Empty if no weeks are installed for that course.
download_week(course, week, dest = ".")
download_week("mc451", 1, dest = ".") # accepts 1, "01", or "week_01"
- Creates
dest/week_01/
(or anotherweek_XX/
) - Copies that week’s files into the folder
- Preserves subfolders
- Empty templates (e.g., holidays) still create the folder but copy no files
Returns (invisibly) a list:
list(dest, course, week, n_copied)
open_week(week, dest = ".")
open_week(1, dest = ".")
Opens dest/week_01/
in your system file browser.
mccourse_setup(ask = TRUE, pkgs = c(...))
mccourse_setup() # safe to re-run; installs only what’s missing
Ensures that:
- Quarto is installed (for rendering
.qmd
) - TinyTeX (LaTeX) is available for PDF output
- A small set of core CRAN packages are installed
mccourse_self_test()
mccourse_self_test()
Runs a basic sanity check: prints which courses are installed and which weeks are available.
mccourse_update()
mccourse_update()
Updates mccoursepack to the latest GitHub version. (Equivalent to running pak::pak("SIM-Lab-SIUE/mccoursepack")
manually.)
Common patterns
- Always open your RStudio Project before using package commands.
- Render
.qmd
files to PDF (default) or HTML with Quarto. - If PDF rendering fails, run:
mccourse_setup()
to install TinyTeX and other dependencies.