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
}

Try the NOISeq package in your browser

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

NOISeq documentation built on Nov. 8, 2020, 5:10 p.m.