PBSmodelling (version 2.68.8)

openExamples: Open Example Files from a Package

Description

Open examples from the examples subdirectory of a given package.

Usage

openExamples(package, prefix, suffix)

Arguments

package

name of the package that contains the examples.

prefix

prefix of the example file(s).

suffix

character vector of suffixes for the example files.

Author

Anisa Egeli, Vancouver Island University, Nanaimo BC

Details

Copies of each example file are placed in the working directory and opened. If files with the same name already exist, the user is prompted with a choice to overwrite.

To use this function in a window description file, the package, prefix and suffix arguments must be specified as the action of the widget that calls openExamples. Furthermore, package, prefix, and each suffix must be separated by commas. For example, action=myPackage,example1,.r,.c will copy example1.r and example2.c from the examples directory of the package myPackage to the working directory and open these files. If the function was called by a widget, a widget named prefix will be set to the specified prefix.

See Also

openFile

Examples

Run this code
if (FALSE) {
# Copies fib.c and fib.r from the examples directory in 
# PBSmodelling to the temporary working directory, and opens these files.
local(envir=.PBSmodEnv,expr={
  cwd = getwd(); setwd(tempdir())
  openExamples("PBSmodelling", c("fib"), c(".r", ".c"))
  setwd(cwd)
})
}

Run the code above in your browser using DataLab