Skip to content

Instantly share code, notes, and snippets.

@mdlincoln
Created Nov 6, 2015
Embed
What would you like to do?
dplyr-friendly verb: replicate the rows of a data_frame n times
row_rep <- function(df, n) {
df[rep(1:nrow(df), times = n),]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment