Skip to content

Instantly share code, notes, and snippets.

@inkhorn
Created March 28, 2012 00:36
Show Gist options
  • Save inkhorn/2222158 to your computer and use it in GitHub Desktop.
Save inkhorn/2222158 to your computer and use it in GitHub Desktop.
Simple Function to Sample Rows from a Data Frame in R
df.sample = function(df.in, n) {
return(df.in[sample(nrow(df.in), size=n),])
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment