Learn R Programming

reproresearchR (version 0.1.1)

chapter_script: Copy or run a textbook chapter script

Description

Copy or run a textbook chapter script

Usage

chapter_script(
  chapter,
  type = c("full", "helper"),
  dest,
  run = FALSE,
  overwrite = FALSE,
  open = FALSE
)

Value

Path to the copied script (invisibly if run = TRUE).

Arguments

chapter

Chapter number (e.g., 1, 2, 3).

type

Script type: "full" or "helper".

dest

Directory to copy the script into.

run

If TRUE, source() the script after copying.

overwrite

If TRUE, overwrite an existing file.

open

If TRUE, attempt to open the copied script in RStudio.

Examples

Run this code
tmp <- tempdir()
chapter_script(3, "helper", dest = tmp, overwrite = TRUE)

# \donttest{
tmp <- tempdir()
chapter_script(3, "helper", dest = tmp, open = TRUE, overwrite = TRUE)
# }

Run the code above in your browser using DataLab