Skip to content

How to extract data?

2 messages · ebashi, Martin Maechler

#
I appreciate if anyone can help me,
I have a table as follow,
DATE VALUE
1   1997-01-10  5.30
2   1997-01-17  5.30
3   1997-01-24  5.28
4   1997-01-31  5.30
5   1997-02-07  5.29
6   1997-02-14  5.26
7   1997-02-21  5.24
8   1997-02-28  5.26
9   1997-03-07  5.30
10  1997-03-14  5.30
.    ......     ...
.    ......     ...
.    ......     ...
I want to extract the DATE(s) on which the VALUE has
already dropped twice and the DATE(s) that VALUE has
already increased for three times,( ignore where
VALUE(i+1)-VALUE(i)=0),I try to use diff() function,
however that works only for one increase or decrease.

Sincerely,

Sean
#
You posted the referenced message to both
R-help and R-sig-finance.

Please do *not* post to more than one R-list!
Please do *not* post to more than one R-list!
Please do *not* post to more than one R-list!
	  
Please decide if something is specific for an R-SIG-<foo> list
or if it belongs to R-help (or R-devel) and post to one and only
one mailing list!

We had another mess recently with this by a posting to both
R-help and R-sig-gui (and I think another one where
even 3 mailing lists where affected). The whole thing is a
particular impoliteness to all those people -- often the nice
helpers! -- who are subscribed to more than one of the implied
lists.

Chosing one list, the discussion thread will be archived/seen/read
consistently both on the server archives and people's mail/news boxes.

- If the thread should be *diverted* to another list, there
  could be *one* overlap message (posting to both), 
  where the move should be announced

- If you deem it relevant, you can still alert the readers of
  one list to a "hot topic" on another list, e.g., by posting an
  URL to the starting message in an (online) archive.

Martin Maechler, ETH Zurich

PS: Of course, I've been tempted for a moment
    to post this to all R- mailing lists  ;-) :-)