R/load.R

Defines functions sampler

# Utility functions

sampler <- function(collection, size){
  if(class(collection)[[1]] == "data.table"){
    return(collection[sample(c(1:NROW(collection)), size = size)])
  }else{
    return(sample(collection, size = size))
  }
}
sujeetp97/compare-functions documentation built on Oct. 31, 2017, 8:45 a.m.