RE: [R] computing differences between consecutive vectorelements

From: Dewez Thomas <t.dewez_at_brgm.fr>
Date: Wed 28 Jul 2004 - 01:04:47 EST


well, sure diff() does it
thanks alot

Thomas

> -----Message d'origine-----
> De: Liaw, Andy [mailto:andy_liaw@merck.com]
> Date: mardi 27 juillet 2004 16:50
> À: 'Dewez Thomas'; 'r-help@stat.math.ethz.ch'
> Objet: RE: [R] computing differences between consecutive
> vectorelements
>
>
> Not exactly sure what you want, but seems like you can sort
> the data frame
> by `t', then do diff() on the x, y, and z columns.
>
> Andy
>
> > From: Dewez Thomas
> >
> > Dear R-users,
> >
> > I am a newbie to R so please excuse this naive question for
> > which I couldn't
> > seem to find online answers.
> >
> > I have this data frame containing a series of locations through time
> > (x,y,z,t). I would like to compute the difference in x, y and
> > z between t-1
> > and t.
> >

> > Sounds easy enough, but how on earth does one loop through
> > vector elements
> > and compute this difference?
> >
> > Thanks
> >
> > Thomas
> > ***
> > Le contenu de cet e-mail et de ses pièces jointes est destiné
> > à l'usage exclusif du
> > (des) destinataire(s) expressément désigné(s) comme tel(s).
> > En cas de réception de cet
> > e-mail par erreur, le signaler à son expéditeur et ne pas en
> > divulguer le contenu.
> > L'absence de virus a été vérifié à l'émission du message. Il
> > convient néanmoins de
> > vérifier l'absence de corruption à sa réception.
> >
> > The contents of this email and any attachments are
> > confidential. They are intended for
> > the named recipient(s) only. If you have received this email
> > in error please notify the
> > system manager or the sender immediately and do not disclose
> > the contents to
> > anyone or make copies. eSafe scanned this email for viruses,
> > vandals and malicious
> > content.
> > ***
> >
> > ______________________________________________
> > R-help@stat.math.ethz.ch mailing list
> > https://www.stat.math.ethz.ch/mailman/listinfo/r-help
> > PLEASE do read the posting guide!
> > http://www.R-project.org/posting-guide.html
> >
> >
>
>
> --------------------------------------------------------------
> ----------------
> Notice: This e-mail message, together with any attachments,
> contains information of Merck & Co., Inc. (One Merck Drive,
> Whitehouse Station, New Jersey, USA 08889), and/or its
> affiliates (which may be known outside the United States as
> Merck Frosst, Merck Sharp & Dohme or MSD and in Japan, as
> Banyu) that may be confidential, proprietary copyrighted
> and/or legally privileged. It is intended solely for the use
> of the individual or entity named on this message. If you
> are not the intended recipient, and have received this
> message in error, please notify us immediately by reply
> e-mail and then delete it from your system.
> --------------------------------------------------------------
> ----------------
>
***
Le contenu de cet e-mail et de ses pièces jointes est destiné à l'usage exclusif du (des) destinataire(s) expressément désigné(s) comme tel(s). En cas de réception de cet  e-mail par erreur, le signaler à son expéditeur et ne pas en divulguer le contenu. L'absence de virus a été vérifié à l'émission du message. Il convient néanmoins de vérifier l'absence de corruption à sa réception.

The contents of this email and any attachments are confidential. They are intended for the named recipient(s) only. If you have received this email in error please notify the system manager or the sender immediately and do not disclose the contents to anyone or make copies. eSafe scanned this email for viruses, vandals and malicious content.
***



R-help@stat.math.ethz.ch mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Wed Jul 28 01:11:59 2004

This archive was generated by hypermail 2.1.8 : Wed 03 Nov 2004 - 22:55:17 EST