View source: R/dthelper-data-wrangling.R
gather.keep | R Documentation |
gather function that allows you to retain some of the existing columns
gather.keep( df, keep = NULL, var.to.gather = NULL, key = "key", value = "value" )
df |
data.frame object |
keep |
Variables that shouldn't be gathered |
var.to.gather |
Variable that should be gathered. Defaults to all other variables apart from keep |
key |
Name of key variable after gathering |
value |
Name of value variable after gathering |
data.frame object
set.seed(100) df <- data.frame( id = 1:10, v1_t1 = rnorm(10), v1_t2 = rnorm(10), v1_t3 = rnorm(10) ) gather.keep(df, keep = "id")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.