[R] vector angle

Evan Zane Macosko macosko at fas.harvard.edu
Tue Jul 17 06:40:30 CEST 2001


Hi everyone,


I'm translating into R some programs I worked through in Matlab to
calculate the angle between two vectors (very large--like 6200 rows in
each vector).  In Matlab, I used a series of nested for loops, because I
was calculating the angles between many pairs of vectors.  I know for
loops are not desirable in R code, so I was wondering if anyone could
recommend a faster way to complete this task.  Also, I have NAs in my
vectors--I've had trouble performing various operations on my vectors in R
because of these NAs.

Any advice on this would be greatly appreciated.

Thanks!
Evan Macosko


-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list