Split Dialog Function

DESCRIPTION:

This function is called by the Split dialog. It is used to split a data.frame into multiple separate data.frames based on the values of a splitting variable

USAGE:

menuSplit(data, split.col, replicate.cols, result.type="Separate", 
     max.numeric.levels=10, nbins=6, save.name,  
     show.p=.Options$show.data.in.view, print.names.p=F) 

REQUIRED ARGUMENTS:

data
Data.frame to split into separate data.frames.
split.col
Character string giving name of column to split.

OPTIONAL ARGUMENTS:

replicate.cols
List of character strings giving names of columns to include in each new data.frame. If missing, all columns are included.
result.type
Character string "List" or "Separate D.F.s". If set to "List", the function returns a list containing the new data.frames. Otherwise the function creates new data.frames in the working directory.
max.numeric.levels
the maximum number of unique values to consider as separate categories in the splitting variables. Numeric variables with more than this many unique values will be binned.
nbins
the number of bins to use for numeric splitting variables. The bins are of equal width and cover the range of the variable.
save.name
character string giving name under which to save result. If this is specified the result will be assigned to the working database under the given name, and will also be returned invisibly. If result.type is "List", this gives the name of the list. If result.type is `"Separate D.F.s", this gives the prefix to use in constructing names for the new data frames.
show.p
logical flag: if TRUE, save.name is specified, and the Windows S-PLUS GUI is active, the result will be displayed in a Data Window.
print.names.p
logical vector: if TRUE and result.type is "Separate D.F.s" then a warning message will be printed listing the names of the new data frames.

VALUE:

If result.type is "List", returns a list of data.frames with one data.frame for each unique value of the splitting variable. If result.type is "Separate D.F.s", invisibly returns a vector giving the names of the new data.frames.

SIDE EFFECTS:

If result.type is "Separate D.F.s", creates new data.frames in the current working database. There will be one new data.frame for each unique value of the splitting variable. The names of the new data.frames are created by concatenating the name of the data with the levels of the splitting variable.

SEE ALSO:

EXAMPLES:

menuSplit(fuel.frame,"Type")