[R] Select the last rows of when specific conditions are met.

mardijk van_dijkmarianne at hotmail.com
Thu Nov 1 20:27:05 CET 2012


I am so sorry for the lack of clarity. 

I have a few subjects, every subject has done a number of trials and per
trial there is a measurement per millisecond (represented in the variable
tt), so every unique trial is represented in around 2500 rows. 

An example of data would be:

Subj | Trial | tt | v4 | v5 | ... | v17
1          1           1     ..
1          1           2     ..
1          1           3     ..
1          1           4     ..
1          1           5     ..
1          2           1     ..
1          2           2     ..
1          2           3     ..
1          3           1     ..
1          3           2     ..
1          3           3     ..
2          1           1     ..
2          1           2     ..
2          1           3     ..
etc. 

In the above dataset, how can I single out the trial that > 4, and delete
the last two rows (tt = 4&5).

I hope this makes more sense.



--
View this message in context: http://r.789695.n4.nabble.com/Select-the-last-rows-of-when-specific-conditions-are-met-tp4648133p4648157.html
Sent from the R help mailing list archive at Nabble.com.




More information about the R-help mailing list