Hello,

I want to subset a data.frame containing the variables "Date" in (%Y %m %d
) and "N".

I want to print "Date" and "N" if  N is less than or equal to 0.3 and if
"N" is also less than or equal to 0.3 on the day before the day where "N"
is less than or equal to 0.3.

This would be the case in line 3 and 4 , 6 and 7, 12 to 18, and so on.

"Date"    "N"
"1"    2010-01-01    0
"2"    2010-01-02    1.9
"3"    2010-01-03    0
"4"    2010-01-04    0
"5"    2010-01-05    1.6
"6"    2010-01-06    0
"7"    2010-01-07    0.3
"8"    2010-01-08    0
"9"    2010-01-09    1.1
"10"    2010-01-10    1.7
"11"    2010-01-11    2.6
"12"    2010-01-12    0
"13"    2010-01-13    0
"14"    2010-01-14    0
"15"    2010-01-15    0
"16"    2010-01-16    0
"17"    2010-01-17    0
"18"    2010-01-18    0.2
"19"    2010-01-19    0
"20"    2010-01-20    0
"21"    2010-01-21    0
"22"    2010-01-22    0
"23"    2010-01-23    0
"24"    2010-01-24    0
"25"    2010-01-25    0
"26"    2010-01-26    0
"27"    2010-01-27    1.9
"28"    2010-01-28    6.2
"29"    2010-01-29    0
"30"    2010-01-30    0

I tried some methods with subset but I couldn't work it out. Maybe I have
to use something like " for (i in x) {} but as a beginner I really don't
know how to do it.

Can somebody please help me with this.

Thanks in advance,

Christoph

        [[alternative HTML version deleted]]

______________________________________________
R-help@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.

Reply via email to