[R] Calculating the Distance
Keizer_71
christophe.lo at gmail.com
Thu Feb 21 00:18:30 CET 2008
***********creating matrix and calculating variance across probesets********
x<-1:20000
y<-2:141
data.matrix<-data.matrix(data[,y])
variableprobe<-apply(data.matrix[x,],1,var)
hist(variableprobe)
**************filter out low variance*************
data.sub = data.matrix[order(variableprobe,decreasing=TRUE),][1:10000,]
dim(data.sub)
[1] 10000 140
summary(data.sub)
a few samples:
Sample_68_C Sample_69_D Sample_69_C Sample_70_D
Sample_70_C
Min. : 1.873 Min. : 1.893 Min. : 1.873 Min. : 1.722 Min.
: 1.871
1st Qu.: 5.202 1st Qu.: 5.176 1st Qu.: 4.176 1st Qu.: 4.763 1st
Qu.: 5.366
Median : 6.559 Median : 6.502 Median : 5.579 Median : 6.208 Median
: 6.622
Mean : 6.473 Mean : 6.445 Mean : 5.697 Mean : 6.189 Mean
: 6.558
3rd Qu.: 7.738 3rd Qu.: 7.742 3rd Qu.: 6.967 3rd Qu.: 7.547 3rd
Qu.: 7.813
Max. :14.953 Max. :14.863 Max. :14.741 Max. :15.102 Max.
:14.975
What is the best way to give me me probes only. I am trying to tell R to
show me all the probes (10,000).
What i want to do is to use the dist function to compute distances between
the samples above. This function will take the matrix and computes the
distances between the rows of the matrix.
I tried dis <- dist(t(exprs(data.sub)), method="euclidean") but it is
measuring the point by point which is too big. I would like to measure the
distances between the rows.
thanks!!!
--
View this message in context: http://www.nabble.com/Calculating-the-Distance-tp15601307p15601307.html
Sent from the R help mailing list archive at Nabble.com.
More information about the R-help
mailing list