Learn R Programming

RSuite (version 0.37-253)

sysreqs_script: Creates a script to update the system to satisfy project requirements.

Description

Collects system requirements with sysreqs_collect and creates a script to build/install them. It creates a .cmd script for Windows and a bash script for Linuxes.

Usage

sysreqs_script(prj = NULL)

Arguments

prj

project object to process sys requirements for. If not passed the loaded project will be used or the default whichever exists. Will init default project from working directory if no default project exists. (type: rsuite_project, default: NULL)

Value

invisible path to script file created or NULL if no system requirements detected.

Examples

Run this code
# NOT RUN {
  # create exemplary project base folder
  prj_base <- tempfile("example_")
  dir.create(prj_base, recursive = TRUE, showWarnings = FALSE)

  # start project
  prj <- prj_start("my_project", skip_rc = TRUE, path = prj_base)

  # add dependency to XML
  write("library(XML)",
        file = file.path(prj$path, "R", "master.R"),
        append = TRUE)

  # generate script
  sysreqs_fpath <- sysreqs_script(prj)

  # present script contents
  cat(readLines(sysreqs_fpath), sep = "\n")
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab