openExamples {PBSmodelling}R Documentation

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.

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.

Note

If all the required arguments are missing, it is assumed that the function is being called by a GUI widget.

Author(s)

Anisa Egeli, Vancouver Island University, Nanaimo BC

See Also

openFile

Examples

## Not run: 
# 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)
})

## End(Not run)

[Package PBSmodelling version 2.69.3 Index]