Stack Dialog Function
DESCRIPTION:
This function is called by the Stack dialog. It is used to convert data
from multiple y columns to a single y column with group membership indicated
by a factor column. This function is deprecated, and has been replaced by
menuStackColumns
.
USAGE:
menuStack(data, stack.cols, replicate.cols, stacked.col.name="stack",
group.col.p=T, group.col.name="group", save.name=NULL,
show.p=.Options$show.data.in.view)
REQUIRED ARGUMENTS:
- data
-
Data.frame containing the unstacked data and related covariates.
- stack.cols
-
List of character strings giving names of columns to stack. These are
the multiple y columns in unstacked format.
OPTIONAL ARGUMENTS:
- replicate.cols
-
List of character strings giving names of columns to replicate. These
columns will be repeated such that each row contains the appropriate
values of the replicated columns along with each stacked value. If
missing, all columns except for the stacked columns will be replicated.
- stacked.col.name
-
Name for new column containing stacked values.
- group.col.p
-
Logical indicating whether to add a factor column giving group membership
for each stacked value. The column names of the stacked columns are used
as the factor levels.
- group.col.name
-
Name for new column containing grouping values.
- 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.
- 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.
VALUE:
Data.frame of replicated columns, stacked values, and optionally grouping
variable
EXAMPLES:
menuStack(lung,list("ph.karno","pat.karno"),list("age","sex"),"karno.score")