[R] Calculate directions between points

2009-03-28 Thread Wanja Mathar
Hi everyone, i have a matrix of points and want to calculate the direction and length of each vector between the points. I can easily calculate the length with dist(testdata), but is their a function that returns a matrix of the direction of the vectors between points (angles 0-360°)? testda

Re: [R] Calculate directions between points

2009-03-29 Thread Wanja Mathar
t;) return(180*angles/pi) if (unit == "radians") return(angles)} returns a matrix with the directions in degrees or radians and sets the angle between the same point to NA Emmanuel Charpentier schrieb: Le samedi 28 mars 2009 à 16:06 +, Wanja Mathar a écrit : Hi everyone, i have a m