Created
August 25, 2014 18:23
-
-
Save hilaryparker/3df60a34ecb13a6a18f6 to your computer and use it in GitHub Desktop.
how I make results dataframes
This file contains 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
results <- tbl_df(as.data.frame(matrix(nrow=length(users), ncol=2))) | |
# what I would love | |
create_tbl_df(nrow=length(users), ncol=2) |
If you don't have a list of unique users then I would do it like this:
library(dplyr)
results<- DF %>%
group_by(User) %>%
summarise(col_name = NA)
Another option if you do have a unique user list is:
library(dplyr)
results<- data.frame(users) %>%
mutate(col_name = NA)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
i do:
so I also want to know what I should have been doing all along.