R/bootsample.R

Defines functions bootsample

Documented in bootsample

#' bootsample
#'
#' @param data a dataset to be bootstrapped
#' @param size the size of the bootstrap sample relative to the original sample
#'
#' @return a dataset
#' @export
#'
#' @examples X<-TestData()
#' Y<-bootsample(X)
bootsample<-function(data, size=1){
  return(as.matrix(data[sample.int(nrow(data),nrow(data)*size, replace = T),]))
}

Try the Omisc package in your browser

Any scripts or data that you put into this service are public.

Omisc documentation built on Aug. 9, 2022, 5:09 p.m.