R/metalist.to.matrix.R

metalist.to.matrix<-function(list,genenames=NULL)
{
n.study<-which(names(list)=="TestStatistic")
xx<-matrix(0,nrow=length(list$TestStatistic), ncol=n.study)
for (i in 1:(n.study-1))
{xx[list[[i]],i]<-1}
xx[,n.study]<-list[[n.study]]
colnames(xx)<-names(list)[1:n.study]
if (is.null(genenames)) rownames(xx)<-list[["gene.names"]] else rownames(xx)<-genenames
return(xx)
}

Try the MAMA package in your browser

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

MAMA documentation built on Jan. 15, 2017, 3:05 p.m.