R/F.perm.sample.R

Defines functions .perm.sample

F.perm.sample <-
function(x, fac, nperm) {
    obs = genefilter::rowFtests(x, fac, var.equal = TRUE)$statistic
	names(obs)=rownames(x)
	perms= matrix(NA,  nrow(x),  nperm)
	
	for(t1 in 1:nperm){
		perms[,t1]=genefilter::rowFtests(x, sample(fac), var.equal = TRUE)$statistic
	}
	rownames(perms)=rownames(x)
	colnames(perms)=paste('B',1:nperm,sep="")
	
	obs=abs(obs); perms=abs(perms)
		
    return(list(obs=obs, perms=perms))
}

Try the MetaPath package in your browser

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

MetaPath documentation built on May 2, 2019, 3:27 a.m.