Last active
March 25, 2017 22:02
-
-
Save Colelyman/98f942bc1de7cd66157e76139c5bd007 to your computer and use it in GitHub Desktop.
Useful tricks for manipulating tibbles with dplyr that I have found useful.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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