Skip to content

Instantly share code, notes, and snippets.

@Colelyman
Last active March 25, 2017 22:02
Show Gist options
  • Save Colelyman/98f942bc1de7cd66157e76139c5bd007 to your computer and use it in GitHub Desktop.
Save Colelyman/98f942bc1de7cd66157e76139c5bd007 to your computer and use it in GitHub Desktop.
Useful tricks for manipulating tibbles with dplyr that I have found useful.
library(tibble)
# create a tibble with no rows, but defined columns
tbl <- tibble(name=character(), age=numeric(), gender=factor())
# add a row to the tibble. The values can even be vectors!!
tbl <- add_row(tbl, name='Steve', age='24', gender='male')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment