#' Resample a Data Frame
#'
#' @param df : a data frame
#' @param size : a non-negative integer giving the number of items to choose.
#' @param replace : should sampling be with replacement?
#' @param prob : a vector of probability weights for obtaining the elements of the vector being sampled.
#'
#' @return a data frame containing the resampled rows.
#' @export
resample_df <- function(df, size, replace = FALSE, prob = NULL){
sample_rows <- sample(1:nrow(df), size, replace, prob)
return(df[sample_rows,])
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.