[R] conditional dataframe search and find

Allan Engelhardt allane at cybaea.com
Sat Jul 3 12:32:56 CEST 2010


 > ct.df[ct.df$conc < 25,"time"]
[1] 10 11 12 13 14 15
 > ct.df[ct.df$conc < 25,"time"][1]
 > df[df$conc < 25,"time"][1]
[1] 10

See also help("order") if conc is not ordered.

On 02/07/10 22:50, oscar linares wrote:
>        time       conc
>     1     0 164.495456
>     2     1 133.671185
>     3     2 108.622975
>     4     3  88.268468
>     5     4  71.728126
>     6     5  58.287225
>     7     6  47.364971
>     8     7  38.489403
>     9     8  31.276998
>     10    9  25.416103
>     11   10  20.653462
>     12   11  16.783276
>     13   12  13.638313
>     14   13  11.082674
>     15   14   9.005927
>     16   15   7.318336
>



More information about the R-help mailing list