Displaying 2 results from an estimated 2 matches for "calcdist".
2005 Dec 29
1
use of tapply?
...hanks
Tom
data.intersects<-data.frame(
x=c(0.230,0.411,0.477,0.241,0.552,0.230),
y=c(0.119,0.515,0.261,0.431,0.304,0.389),
angle=vector(length=6),
length=vector(length=6),
row.names=c('tbr','trg','dbr','dbg','pbr','pbg'))
calcDist<-function(x,y){
#calcualates distance from origin (C)
origin<-data.frame(x=0.34,y=0.36)
dx<-origin$x-x
dy<-origin$y-y
length<-sqrt(dx^2+dy^2)
angle<-asin(dy/length)
return(list('length'=length,'angle'=angle))
}
for(iLoc in 1:length(dat...
2004 Apr 22
1
slower execution in R 1.9.0
....4 9.78 8.2
pweibull 0.38 0.3 0.38 0.3
top 5 operations under 1.7.1
self.time self.pct total.time total.pct
pweibull 2.62 55.7 2.62 55.7
^ 0.76 16.2 0.76 16.2
CalcDistance 0.16 3.4 1.26 26.8
FMD 0.16 3.4 4.70 100.0
matrix 0.14 3.0 0.14 3.0
- Scott Bartell