scripts: Create a local copy of the tutorials.

View source: R/utilities.R

scriptsR Documentation

Create a local copy of the tutorials.

Description

Create a local copy of the tutorials.

Usage

scripts(
  path = file.path(if (.Platform$OS.type == "windows") {
     Sys.getenv("USERPROFILE")

    } else {
     "~"
 }, "Downloads", "ICI3D"),
  overwrite = FALSE,
  what = c("scripts", "solutions")
)

Arguments

path

string; the path to enclosing directory. If this directory does not exist, will create it

overwrite

logical; overwrite existing files (corresponding to the course scripts)?

what

string: the "scripts" or the "solutions"?

Details

This function creates a local copy of the R scripts associated with the ICI3D short courses, for students to edit and run during learning activities. These scripts should only require the ICI3D package and associated dependencies.

The created directory contains several subdirectories, each corresponding to a different session. Within each directory, the exercise files are generally named NN_short_description.R (where NN is 00, 01, etc - corresponding to the expected order of completion, with the 00 session being background / preparatory content).

If used with default what argument, you will get a "scripts" subdirectory, and if you ask for what = "solutions" there will be a "solutions" subdirectory. Both will contain sessions by name, scripts by order and shortname, without and with solutions filled in, respectively.

Value

string or NULL; non-NULL indicates successful creation + copy and is the top level root of the course material.

Examples

tardir <- ICI3D::scripts()
list.files(tardir, recursive = TRUE)


ICI3D/ici3d-pkg documentation built on July 2, 2024, 12:35 p.m.