R/sample.ds.R

Defines functions sample.ds

Documented in sample.ds

sample.ds<-function(dat,dur){
  nrow <- nrow(dat)
  l <- length(table(dat$dur))
  
  sample<-sample(1:nrow,nrow,replace=TRUE)
  
  l.sample<-length(table(dat[sample,]$dur))
  while((l.sample!=l)){
    
    sample<-sample(1:nrow,nrow,replace=TRUE)
    l.sample<-length(table(dat[sample,]$dur))

    }

  return(dat[sample,])
  }

Try the DStree package in your browser

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

DStree documentation built on May 2, 2019, 3:37 p.m.