| openExamples | R Documentation |
Open examples from the examples subdirectory of a given package.
openExamples(package, prefix, suffix)
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. |
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.
If all the required arguments are missing, it is assumed that the function is being called by a GUI widget.
Anisa Egeli, Vancouver Island University, Nanaimo BC
openFile
## 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.