longen | R Documentation |
Create long format of a dataframe, keeping the id column.
longen(df, id = "id")
df |
Dataframe with a key variable ( |
id |
name of the key variable in the dataframe. |
Dataframe consisting of 3 columns id
, var
& val
,
containing the dataframe in long format (based on dplyr::gather).
# load spss data path <- system.file("examples", "iris.sav", package = "haven") df <- haven::read_sav(path) %>% # add id column tibble::rownames_to_column("id") df %>% longen()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.