Skip to content

Instantly share code, notes, and snippets.

@batpigandme
Created October 23, 2018 11:58
Show Gist options
  • Save batpigandme/4174df10ac7355054ff8e5fb81ee0631 to your computer and use it in GitHub Desktop.
Save batpigandme/4174df10ac7355054ff8e5fb81ee0631 to your computer and use it in GitHub Desktop.
library(tidyverse, warn.conflicts = FALSE)
# data frame
mtcars
# as tibble
as.tibble(mtcars)
# rownames_to_column()
rownames_to_column(mtcars)
# rownames to column *and* tibble
as_tibble(rownames_to_column(mtcars))
# DON'T DO THIS
as.tibble(mtcars) %>% rownames_to_column()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment