This function requires the bigdata library section to be loaded.
bd.transpose(data, columns=NULL, names.column=NULL, auto.name=F, max.rows=10000)
bdFrame
or
data.frame
.
TRUE
and
names.column
is
NULL
,
use first categorical or string column.
"bdFrame"
or
"data.frame"
(the same class as
x
).
This function turns a set of columns into a set of rows.
Another column may be specified to create new column names from.
If no columns are specified, all the continuous columns are transposed.
If no
names.column
has been specified
and
auto.name
is
TRUE
,
then the first categorical or string column will be used for column names.
There are two limitations to this function: (1) the columns must be of the same type; (2) there is a practical limit to the number of columns that can be usefully created.
# Transpose Weight & Disp. columns of fuel.frame: bd.transpose(fuel.frame, c("Weight", "Disp.")) # Transpose Weight & Disp. and use Type as the column names bd.transpose(fuel.frame, c("Weight","Disp."), "Type") bd.transpose(fuel.frame, c("Weight","Disp."), auto.name=T)