createVector: Create a GUI with a Vector Widget

Description Usage Arguments Author(s) See Also Examples

View source: R/supportFuns.r

Description

Create a basic window containing a vector and a submit button. This provides a quick way to create a window without the need for a window description file.

Usage

1
2
createVector(vec, vectorLabels=NULL, func="", 
    windowname="vectorwindow", env=NULL)

Arguments

vec

a vector of strings representing widget variables. The values in vec become the default values for the widget. If vec is named, the names are used as the variable names.

vectorLabels

an optional vector of strings to use as labels above each widget.

func

string name of function to call when new data are entered in widget boxes or when "GO" is pressed.

windowname

unique window name, required if multiple vector windows are created.

env

an environment in which to evaluate widget callback functions.

Author(s)

Alex Couture-Beil, Vancouver Island University, Nanaimo BC

See Also

createWin

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
## Not run: 
local(envir=.PBSmodEnv,expr={
#user defined function which is called on new data  
drawLiss <- function() {
  oldpar = par(no.readonly=TRUE); on.exit(par(oldpar))
  getWinVal(scope="L");
  tt <- 2*pi*(0:k)/k; x <- sin(2*pi*m*tt); y <- sin(2*pi*(n*tt+phi));
  plot(x,y,type="p"); invisible(NULL); };

#create the vector window
createVector(c(m=2, n=3, phi=0, k=1000), func="drawLiss",
  vectorLabels=c("x cycles","y cycles", "y phase", "points"));
})

## End(Not run)

PBSmodelling documentation built on Dec. 27, 2017, 5:03 p.m.