Combine data from several rows into a single row based on common data in selected columns.
a data frame containing the columns to be combined.
the names of the columns that form a row in the output dataset. Each unique combination of values in these columns will be a new row in the output dataset.
the name of a single column. For each unique value in
the names of the columns to be collected. See Details.
group2row combines data from several rows into a single
row. Certain columns in the input dataset are said to be "collected." Other
columns may be "carried" into the output dataset by listing them in
carryColumns. A new row will be created for each unique combination of
values in the
carryColumns. The output row consists of the carried
columns plus new columns that are named by the unique values in the
splitColumn concatenated with the names in the
The number of columns in the output data frame is equal to the number of
carryColumns plus the number of unique values in the
splitColumn times the number of names in the
The strategy for collecting columns is to use a set of index values defined
splitColumn. The maximum number of input rows collected for
each output row is equal to the number of unique values defined in the
splitColumn is used to identify a column from
the input data that contains output column information. If a row of input has
a value in this column that matches one of the index values, then that row's
data will be included in the output in the column positions corresponding to
the matched index. The index values are concatenated with the input column
names of the collected columns to derive output column names.
Added from smwrBase.
1 2 3 4 5 6 7
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.