[R] flagging values without a loop

jcrosbie james at crosb.ie
Thu Jun 7 16:17:00 CEST 2012


For a given hour I want to be able to  add a new column called flag.  The
flag column will flag the highest price in a given hour.  Is there a way to
do this without a loop? 

matrix:
Unit,	Day,	Hour,	Price,	Flag
afd1	1/2/2003	1	1	N
afd1	1/2/2003	1	2	N
afd1	1/2/2003	1	3	N
afd1	1/2/2003	1	4	Y
dcf1	1/2/2003	2	2	N
dcf1	1/2/2003	2	3	Y
dcf1	1/2/2003	2	1	N
dcf1	1/2/2003	2	2	N
dcf1	1/2/2003	2	3	Y
ghg2	1/2/2003	3	1	N
afd1	1/2/2003	3	2	N
.....


--
View this message in context: http://r.789695.n4.nabble.com/flagging-values-without-a-loop-tp4632689.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list