search for: _my_function

Displaying 1 result from an estimated 1 matches for "_my_function".

Did you mean: my_function
2006 Jul 05
1
R 2.3.1 on Mac OSX: apply a function to 'dist()' ?
Dear all, maybe there is someone who has an hint for me. I have to calculate a distance matrix by using my own function to get the distance between two rows of my matrix. The normal way to do this is to use two 'for loops' like for(i in 1:nrow) for(j in i:nrow) _my_function(matrix[i,],matrix[j,]) OK. This works, but unfortunately I have a very huge matrix and it takes hours even on a cpu-cluster. My question is: Is there any chance to increase the speed of doing this? My first idea was to apply my function to 'dist()' like 'outer (x,y,"fun"...