Skip to content

Instantly share code, notes, and snippets.

@grayskripko
Last active February 5, 2019 14:34
Show Gist options
  • Save grayskripko/845390df69d21752667f2f22272e2523 to your computer and use it in GitHub Desktop.
Save grayskripko/845390df69d21752667f2f22272e2523 to your computer and use it in GitHub Desktop.
tidyverse transpose
# see also https://community.rstudio.com/t/mutate-for-rows/23111
df_with_one_dtype %>%
rownames_to_column() %>%
gather(var, value, -rowname) %>%
spread(rowname, value)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment