Message-ID: <50605013.3000003@sapo.pt>
Date: 2012-09-24T12:20:35Z
From: Rui Barradas
Subject: serial subtraction within a vector
In-Reply-To: <CAKyZeBucLm0-WXM++wPLBaXKDF6AL4fq583M6nkrXRUoBjbNoQ@mail.gmail.com>
Hello,
Try diff(v)
Hope this helps,
Rui Barradas
Em 24-09-2012 12:00, Hermann Norpois escreveu:
> Hello,
>
> I have a vector (numeric) v-> c(a,b,c,d,e) and I want to create the vector
> n->c(b-a,c-b,d-c,e-d). How can I do that?
>
>
> Thank you
> Hermann
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.