R/sample2.R

Defines functions sample2

sample2=function(x, size, replace = FALSE, prob = NULL){
  if (missing(size)){ size <- length(x)}
  x[sample.int(length(x), size, replace, prob)]
}
 
stefanomonni/spavs documentation built on April 5, 2022, 1:26 a.m.