Description Usage Arguments Value Examples
View source: R/gather_variables.R
gather_variables
gathers variables from a particularly formated dataframe. View examples for details.
1 2 | gather_variables(x, start = 2, end = length(x), timeInd = 1,
entity.position = "before")
|
x |
A dataframe. |
start |
Column index of where variables to be gathered starts |
end |
Column index of where variables to be gathered ends |
timeInd |
Column index of time variable |
entity.position |
Before or After. Are the entity names before or after the seperator in the variable names? |
A long tidy dataframe of x
with entities merged into one variable.
1 2 3 4 | df <- data.frame(x = 2010:2018, CAN_Bonds = runif(9), US_Bonds = runif(9),
CAN_Debt = rnorm(9, 100, 30), US_Debt = rnorm(9, 100, 30))
gather_variables(df)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.