Transpose Data

DESCRIPTION:

Turn a set of columns into a set of rows.

This function requires the bigdata library section to be loaded.

USAGE:

bd.transpose(data, columns=NULL, names.column=NULL,
             auto.name=F, max.rows=10000)

REQUIRED ARGUMENTS:

data
a bdFrame or data.frame.

OPTIONAL ARGUMENTS:

columns
names or numbers of columns to be transposed. Defaults to all continuous columns.
names.column
name or number of column that stores the newly transposed columns' names.
auto.name
if TRUE and names.column is NULL, use first categorical or string column.
max.rows
prevents column explosion by limiting the number of rows to be transposed.

VALUE:

an object of class "bdFrame" or "data.frame" (the same class as x).

DETAILS:

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.

SEE ALSO:

.

EXAMPLES:

# 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)