Entering edit mode
Scott Ochsner
▴
300
@scott-ochsner-599
Last seen 10.2 years ago
Hello,
In the following code how would I get R to search the pData slot of z
in order to select which columns to average? I can easily write "1:4"
to select the columns but I would like to make this function more
generic. In addition, if anyone can clean up the following code or
point me to an easier way
to do this I would greatly appreciate it.
thanks,
where dataset=normalized and modeled expression set; z=exprs(dataset)
avg<-function(z){
x<-length(rownames(z))
y<-length(unique(pData(eset)))
ii<-0
means<<-array(dim=c(x,y))
ans<-array(dim=c(x,y))
while (ii<x){ ii<-(ii+1)="" means[ii,]<<-c(mean(z[ii,1:2]),mean(z[ii,3:4]))="" ans<-means="" }}="" scott="" a.="" ochsner,="" ph.d.="" baylor="" college="" of="" medicine="" one="" baylor="" plaza,="" n810="" houston,="" tx.="" 77030="" lab="" phone:="" 713-798-1620="" office="" phone:="" 713-798-1585="" fax:="" 713-798-4161="" <="" div="">