R/makenull.R

Defines functions makenull

Documented in makenull

makenull <- function(dataset,nullit=NA, estimator="pearson", disc="equalwidth"){
     
     if(!is.matrix(dataset)){
        cat("dataset not a matrix\n")
        dataset <- as.matrix(dataset)
     }
     
     rown <- nrow(dataset)
     coln <- ncol(dataset)
     null <- c()

     if(is.na(nullit)){
       nullit=ceiling(10^5/(((rown*rown)/2)-rown))
     }     

     for (i in 1:nullit) {
         expdata <- matrix(sample(dataset), rown, coln)
         mim <- mimwrap(expdata, estimator=estimator, disc=disc)
         miv <- mim[upper.tri(mim)]
         miv <- miv[miv != 0]
         miv <- as.vector(miv)
         null <- c(null, miv)
     }

     null <- sort(null)
     return(null)
}

Try the bc3net package in your browser

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

bc3net documentation built on May 30, 2017, 5:22 a.m.