Skip to content

Instantly share code, notes, and snippets.

@dwhdai
Created February 15, 2019 16:46
Show Gist options
  • Save dwhdai/62f420fac37f507c5f8e38e07f36a7ff to your computer and use it in GitHub Desktop.
Save dwhdai/62f420fac37f507c5f8e38e07f36a7ff to your computer and use it in GitHub Desktop.
Transposing multiple columns using tidyr
df_wide <- df_long %>%
gather(key, value, -group) %>%
unite(temp, group, key) %>%
spread(temp, value)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment