Learn R Programming

RSurvey (version 0.6-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
lsit; see ManageData.
index
integer; an element index number in cols (optional).
parent
tkwin; the parent window (optional).

Value

  • Results in a character string of the edited function; when evaluated, this text must be parseable and result in a vector of 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

parse, EvalFunction

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