Type: Package
Title: Checks 'R' Configuration Set Up Correctly Before Class
Version: 0.1.3
Description: Checks that students have the correct version of 'R', 'R' packages, 'RStudio' and other dependencies installed, and that the recommended 'RStudio' configuration has been applied.
License: MIT + file LICENSE
Encoding: UTF-8
URL: https://github.com/richardjtelford/checker/
BugReports: https://github.com/richardjtelford/checker/issues
Imports: yaml, rstudioapi, cli
Suggests: quarto, glue
RoxygenNote: 7.2.3
NeedsCompilation: no
Packaged: 2023-04-26 13:02:27 UTC; gbsrt
Author: Richard J. Telford ORCID iD [aut, cre]
Maintainer: Richard J. Telford <richard.telford@uib.no>
Repository: CRAN
Date/Publication: 2023-04-26 13:22:30 UTC

Makes a yaml file with required packages etc

Description

Makes a yaml file with required packages etc

Usage

chk_make(path, programs, packages, options)

Arguments

path

File name and path. If missing will print to screen.

programs

data.frame of required programs.

packages

data.frame of required packages

options

data.frame of recommended 'RStudio' options

Details

Programs are checked against names of programs known by checker. Unknown programs are ignored with a message. packages are checked against installed packages. A message is given if there are any unknown packages. options are checked against a curated list of 'RStudio' options taken from usethis:::rstudio_prefs_read(). See also https://docs.posit.co/ide/server-pro/session_user_settings/session_user_settings.html. A message is given if any are not recognised.

Value

Returns a the yaml, invisibly, as a character vector. Main purpose is to write the yaml to a file.

Examples

pak <- read.csv(
  text = "package, recommended, minimum, message
        dplyr, 1.0.9, NA, NA
        ggplot2, 3.3.5, 3.3.1, NA",
  strip.white = TRUE
)

prog <- read.csv(text = 'program, recommended, minimum, message
             rstudio, 2022.12.0.353, NA, NA
             R, "4.2.2", "4.1.1", NA
             git, NA, NA, NA',
             strip.white = TRUE)
opt <- read.csv(text = 'option, value, message
             "save_workspace", "never", NA
             "load_workspace", "FALSE", "For reproducibility"',
             strip.white = TRUE)

f  <- tempfile(fileext = ".yaml")
(chk_make(path = f, programs = prog, packages = pak, options = opt))
#chk_requirements(f)
unlink(f)

Check R set up before a class

Description

Checks that the required versions of 'R', 'RStudio', 'R' packages and other dependencies are installed.

Usage

chk_requirements(path = system.file("default.yaml", package = "checker"))

Arguments

path

path to yaml file. Defaults to a file that comes with the package.

Details

chk_requirements() checks that the computer set up before class. It check

These requirements are specified in a yaml file specified by the path argument which can be on the users computer or at a URL. If not set, the function defaults to using a built-in yaml file, which may not require the latest version.

Value

No return value, output is printed

Examples

chk_requirements()