[R] R-help? how to take difference in next two elements
gunter.berton at gene.com
Mon Aug 11 21:18:18 CEST 2008
Please use R's help resources before posting.
help.search("difference") will give you your answer (?diff).
-- Bert Gunter
From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org] On
Behalf Of dott
Sent: Monday, August 11, 2008 8:27 AM
To: r-help at r-project.org
Subject: [R] R-help? how to take difference in next two elements
I'd like to take difference for a sequence a between a_i and a_i-2, for
I need (2, 5, -3) as a result. If not using a for loop, can anyone help me?
Thanks a lot.
View this message in context:
Sent from the R help mailing list archive at Nabble.com.
R-help at r-project.org mailing list
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
More information about the R-help