EditFunction: GUI: Function Editor

Description Usage Arguments Details Value Author(s) See Also Examples

Description

A graphical user interface (GUI) for defining functions in the R language.

Usage

1
2
EditFunction(cols, index = NULL, fun = NULL, value.length = NULL,
  value.class = NULL, win.title = "Edit Function", parent = NULL)

Arguments

cols

list. y

index

integer. An element index number in cols.

fun

character. Existing function, only used if index = NULL

value.length

integer. Required length for the evaluated function.

value.class

character. Required class for the evaluated function.

win.title

character. String to display as the title of the dialog box.

parent

tkwin. GUI parent window

Details

This GUI is appropriate for deriving new variables in a pre-existing data frame or query building.

Value

Returns an object of class list with the following components:

fun

user defined function (when evaluated, this string must be parseable).

class

object class for the evaluated function.

summary

default summary for the evaluated function.

sample

first non-missing value for the evaluated function.

Author(s)

J.C. Fisher, U.S. Geological Survey, Idaho Water Science Center

See Also

EvalFunction

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
## Not run: 
  d <- list(x = 1:10, y = 10:1)
  Data("data.raw", d)
  cols <- list()
  cols[[1]] <- list(id = "X", index = 1, fun = "\"X\"")
  cols[[2]] <- list(id = "Y", index = 2, fun = "\"Y\"")
  cols[[3]] <- list(id = "New Variable", fun = "\"X\" + \"Y\"")
  EditFunction(cols, index = 3)

## End(Not run)

USGS-R/RSurvey documentation built on May 9, 2019, 6:10 p.m.