.reshape_gather | R Documentation |
gather
of package dplyr
and reshape
This function is like gather
and reshape(direction="long")
. Like gather
, it outputs names of variables that are gathered (ie turned from wide to long format). (reshape
outputs a numeric variable for assumed discrete time.) In addition to variable name and value, it outputs (like reshape
) a third variable retaining the wide format row information. reshape
names this variable id
; the current function names the variable wide.row
.
.reshape_gather(data, columns, key, value, wide.row = TRUE)
data |
A data frame |
columns |
Columns to be gathered |
key |
New variable to store names of columns being gathered |
value |
New variable to contain values of columns being gathered |
wide.row |
Whether to include a variable named |
A data frame with the two new variables named in arguments key
and value
, plus a third new variable named wide.row
. The remaining variables of the input dataset are carried over.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.