runscript {FinTS} | R Documentation |
Run a script associated with a particular chapter
runscript(x, method=c('run', 'copy', 'view', 'dir'), ask = TRUE, fmt="ch%02d.R", package="FinTS", subdir="scripts", lib.loc=NULL)
x |
an object to identify a file in package/subdir via sprintf(fmt, x).
For example, the default 'fmt' translates x = 2 into 'ch02.R'. If no 'x' is specified, a directory of options is provided. CAUTION: Under some systems like ESS (Emacs Speaks Statistics) under Windows, pop-up menus such as produced by 'runscript()' may not work properly. |
method |
One of the following:
Partial matching is allowed. |
ask |
logical: Should 'par(ask=TRUE)' should be called before graphical output happens from the scruot? |
fmt |
a format to be used with 'x' in sprintf to create the name of a file in lib.loc/package/subdir. |
subdir |
subdirectory of package containing a file of the name constructed via sprintf(fmt, x) |
package |
Name of a package with subdirectory 'subdir'. |
lib.loc |
NULL or character string identifying the location where 'system.file(subdir, package, lib.loc)' will find the folder containing the file identified via sprintf(fmt, x) |
the full full path and filename, invisibly unless method == 'dir'
Gabor Grothendieck and Spencer Graves
demo
sprintf
system.file
package.dir
Stangle
vignette
example
## Not run: # provide a menu runscript() # run ~R\library\FinTS\scripts\ch01.R runscript(1) # same as: runscript(1, "run") # make a copy as 'ch01.R' in the working directory runscript(1, 'copy') # display only runscript(1, 'view') # where is it? runscript(1, 'dir') # run ~R\library\nlme\scripts\afda-ch01.R if(require(fda)) runscript(1, fmt="afda-ch ## End(Not run)