Displaying 1 result from an estimated 1 matches for "distancecorrect".
Did you mean:
distancecorrected
2012 Aug 01
3
repeating a function across a data frame
...e R spit out a matrix of distances
between the samples. So far, I have made a function to calculate the
distance between any two samples:
DistanceCalc<-function(x,y){#x and y are both vectors - the entire reading
set for sample x and
#sample y, respectively
distance<-sqrt(sum((x-y).^2))
distanceCorrected<-distance/sqrt(length(x))#to force the maximum possible
value to =1
print(distanceCorrected)
}
The next thing I want to do is to make this function run to compare all
possible combinations of my samples (1vs1, 1vs2, 1vs3...2vs1, 2vs2 etc). In
python, the only other programming language I h...