R/makeASCAdesign.R

Defines functions make.ASCA.design

make.ASCA.design <- function(x)
{
x<-as.factor(x)
levels<-unique(x)
n<-length(x)
p<-length(levels)

Design<-matrix(0,nrow=n,ncol=p)

for (i in 1:n){
	for (j in 1:p){
	
	if (x[i]==levels[j])
	{
	Design[i,j]=1
	}
	}
}
colnames(Design)<-levels

output<-Design
output
}
SoniaTC/NOISeq documentation built on July 28, 2020, 6:31 p.m.