Description Usage Arguments Value Examples
Spread key-values pairs, where one key maps analogously onto multiple values,
into across multiple columns. Equivalent to calling spread
separately
for dataframes with the same key and different values,
and joining them column-wise back into one dataframe.
1 2 |
data |
A data frame. |
key |
Column names, unquoted, passed in using |
... |
A selection of columns containing values to be spread.
again, unquoted. Accepts |
name_order |
Which identifier comes first in final colname?
Choose |
sep |
Separator to use between values, ultimately ending up in colnames.
Passed to |
fill |
If set, missing values will be replaced with this value. Note
that there are two types of missingness in the input: explicit missing
values (i.e. |
convert |
If |
drop |
If |
A data frame, "fully" spread by all indicated columns.
1 2 3 4 5 6 7 | data <- expand.grid(
id = 1L:10L,
condition = c("a", "b"),
value_1 = 1L,
value_2 = 0L)
super_spread(data, condition, value_1:value_2)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.