This function requires the bigdata library section to be loaded.
bd.stack(data, columns, replicate=character(0), stack.column.name="STACK.value", group.column.name=NULL)
bdFrame
or
data.frame
.
NULL
, name of an additional group column to be created
in the output data set.
In each output row, the group column contains
the name of the original column that
contained the data value in the new stacked column.
bdFrame
or
data.frame
,
of the same type as
x
.
This function combines the stack columns into a single column; the values of the replicate columns are replicated in parallel. Each row in the output data contains a stacked value and the corresponding values of the replicated columns. All columns to be stacked must be of the same type.
## Stack numeric columns "Mileage" and "Fuel", ## keeping the "Type" column, and adding a ## group column bd.stack(fuel.frame[1:5,], c("Mileage", "Fuel"), replicate="Type", group.column.name="STACK.var")