Re: [R] distance between consecutive points

2011-02-15 Thread Richard M. Heiberger
cy Webber > > Sent: Tuesday, February 15, 2011 4:10 PM > > To: r-help@r-project.org > > Subject: [R] distance between consecutive points > > > > Dear R users, > > > > I have two coloumns of data, say x and y, referring to a list of > > points in 2D space.

Re: [R] distance between consecutive points

2011-02-15 Thread William Dunlap
> -Original Message- > From: r-help-boun...@r-project.org > [mailto:r-help-boun...@r-project.org] On Behalf Of Darcy Webber > Sent: Tuesday, February 15, 2011 4:10 PM > To: r-help@r-project.org > Subject: [R] distance between consecutive points > > Dear R users,

Re: [R] distance between consecutive points

2011-02-15 Thread David Winsemius
y, 16 February 2011 1:10 p.m. To: r-help@r-project.org Subject: [R] distance between consecutive points Dear R users, I have two coloumns of data, say x and y, referring to a list of points in 2D space. I am trying to develop a code that will give me the distances (using Pythagoras) between consec

Re: [R] distance between consecutive points

2011-02-15 Thread Peter Alspach
r-help@r-project.org > Subject: [R] distance between consecutive points > > Dear R users, > > I have two coloumns of data, say x and y, referring to a list of > points in 2D space. I am trying to develop a code that will give me > the distances (using Pythagoras) between co

[R] distance between consecutive points

2011-02-15 Thread Darcy Webber
Dear R users, I have two coloumns of data, say x and y, referring to a list of points in 2D space. I am trying to develop a code that will give me the distances (using Pythagoras) between consecutive points (xi,yi) and (xi+1,yi+1). So far I have come up with the following: for (i in 1:length(x))