Learn R Programming

RSurvey (version 0.7-0)

EditFunction: Function Editor for Table Data

Description

A GUI for defining functions in the Rlanguage.

Usage

EditFunction(cols, index = NULL, parent = NULL)

Arguments

cols
list; see ManageData.
index
integer; an element index number in cols.
parent
tkwin; the GUI parent window.

Value

  • Results in a character string of the user defined function; when evaluated, this string must be parseable and result in a vector length equal to the number of rows in the data.raw data frame, see ReadData.

Details

This GUI is appropriate for defining new variables in a pre-existing data frame.

See Also

EvalFunction, parse

Examples

Run this code
data(tritest)
Data("data.raw", as.data.frame(tritest))
cols <- list()
cols[[1]] <- list(id = "X", index = 1, fun = "DATA[[\"X\"]]")
cols[[2]] <- list(id = "Y", index = 2, fun = "DATA[[\"Y\"]]")
cols[[3]] <- list(id = "New Variable",
                  fun = "DATA[[\"X\"]] + DATA[[\"Y\"]]")
EditFunction(cols, index = 3)

Run the code above in your browser using DataLab